Skip to main content

Determining Periodicity with Fourier?


Note: This question has previously been marked as a duplicate of What do the X and Y axis stand for in the Fourier transform domain?. While the answer will likely have an overlap, so the question should be linked, I see the context and background as sufficiently different to warrant a separate question for anyone who is having a similar issue to what I'm having; and it has been noted that some additional information may be useful in answering this question.


I'm trying to find the periods of time series and was directed toward Fourier analysis. I am having a hard time understanding what is going on in ref/Fourier > Applications > Frequency Identification. Would anyone be able to explain, or direct me to an explanation somewhere? Thank you!


Here is some sample data. It is a list representing a 55-year time series with one measurement per year, for a total of 56 points. What I have been doing is subtracting off the seventh-order polynomial regression and running the absolute value of the fourier on both the raw data and the data with the overall trend removed.


{0.,0.,0.,0.00118064,0.,0.00437956,0.,0.,0.0035461,0.00107875,0.00715015,0.00501505,0.0040568,0.00294985,0.00514933,0.00609137,0.0047619,0.00100806,0.00196464,0.000882613,0.00187793,0.00282486,0.00172563,0.000807754,0.00318218,0.00233645,0.0015528,0.00149365,0.000776398,0.000688705,0.00198151,0.00236593,0.00225904,0.00149589,0.,0.00332889,0.00179748,0.00126743,0.00289352,0.00218103,0.00265675,0.00104275,0.00509495,0.00292887,0.00161616,0.00327869,0.00413793,0.00223928,0.00502067,0.00434075,0.00392465,0.00469373,0.00595745,0.00521147,0.00567752,0.00293255}

Note, for the Fourier graphs below, the data have not been padded to the right; should I do that?


enter image description here



enter image description here


enter image description here


enter image description here




Comments

Popular posts from this blog

functions - Get leading series expansion term?

Given a function f[x] , I would like to have a function leadingSeries that returns just the leading term in the series around x=0 . For example: leadingSeries[(1/x + 2)/(4 + 1/x^2 + x)] x and leadingSeries[(1/x + 2 + (1 - 1/x^3)/4)/(4 + x)] -(1/(16 x^3)) Is there such a function in Mathematica? Or maybe one can implement it efficiently? EDIT I finally went with the following implementation, based on Carl Woll 's answer: lds[ex_,x_]:=( (ex/.x->(x+O[x]^2))/.SeriesData[U_,Z_,L_List,Mi_,Ma_,De_]:>SeriesData[U,Z,{L[[1]]},Mi,Mi+1,De]//Quiet//Normal) The advantage is, that this one also properly works with functions whose leading term is a constant: lds[Exp[x],x] 1 Answer Update 1 Updated to eliminate SeriesData and to not return additional terms Perhaps you could use: leadingSeries[expr_, x_] := Normal[expr /. x->(x+O[x]^2) /. a_List :> Take[a, 1]] Then for your examples: leadingSeries[(1/x + 2)/(4 + 1/x^2 + x), x] leadingSeries[Exp[x], x] leadingSeries[(1/x + 2 + (1 - 1/x...

How to thread a list

I have data in format data = {{a1, a2}, {b1, b2}, {c1, c2}, {d1, d2}} Tableform: I want to thread it to : tdata = {{{a1, b1}, {a2, b2}}, {{a1, c1}, {a2, c2}}, {{a1, d1}, {a2, d2}}} Tableform: And I would like to do better then pseudofunction[n_] := Transpose[{data2[[1]], data2[[n]]}]; SetAttributes[pseudofunction, Listable]; Range[2, 4] // pseudofunction Here is my benchmark data, where data3 is normal sample of real data. data3 = Drop[ExcelWorkBook[[Column1 ;; Column4]], None, 1]; data2 = {a #, b #, c #, d #} & /@ Range[1, 10^5]; data = RandomReal[{0, 1}, {10^6, 4}]; Here is my benchmark code kptnw[list_] := Transpose[{Table[First@#, {Length@# - 1}], Rest@#}, {3, 1, 2}] &@list kptnw2[list_] := Transpose[{ConstantArray[First@#, Length@# - 1], Rest@#}, {3, 1, 2}] &@list OleksandrR[list_] := Flatten[Outer[List, List@First[list], Rest[list], 1], {{2}, {1, 4}}] paradox2[list_] := Partition[Riffle[list[[1]], #], 2] & /@ Drop[list, 1] RM[list_] := FoldList[Transpose[{First@li...

front end - keyboard shortcut to invoke Insert new matrix

I frequently need to type in some matrices, and the menu command Insert > Table/Matrix > New... allows matrices with lines drawn between columns and rows, which is very helpful. I would like to make a keyboard shortcut for it, but cannot find the relevant frontend token command (4209405) for it. Since the FullForm[] and InputForm[] of matrices with lines drawn between rows and columns is the same as those without lines, it's hard to do this via 3rd party system-wide text expanders (e.g. autohotkey or atext on mac). How does one assign a keyboard shortcut for the menu item Insert > Table/Matrix > New... , preferably using only mathematica? Thanks! Answer In the MenuSetup.tr (for linux located in the $InstallationDirectory/SystemFiles/FrontEnd/TextResources/X/ directory), I changed the line MenuItem["&New...", "CreateGridBoxDialog"] to read MenuItem["&New...", "CreateGridBoxDialog", MenuKey["m", Modifiers-...