2
$\begingroup$

I came across this interesting article where the author used FFT to discover some patterns in a time series. I am new to this kind of analysis and have maybe some basic questions about it.

How do you compute the Frequency when getting the FFT? I used the fft function in MATLAB with some data I have and then plot the absolute value and plot it. But the X-axis is time. I want to know how to transform that to a Frequency axis. Is it just 1/day? I also have a 1-day granularity. In other words, how does he go from the 2nd to 3rd plot in the article or vice versa?

Also, how would you compare lots of time series using this technique once at a time?

$\endgroup$
4
  • $\begingroup$ The X axis should not be time - typically it will be an integer between 1 and the number of bins you call FFT with (a power of 2). For example, if you call FFT with 256 points, then bin 256 corresponds to 1/2 of your sampling frequency, and bin 1 corresponds to -1/2 the sampling frequency. Since your sampling frequency is every day, then the N bins in the FFT will be spaced by (2/N) (days)$^{-1}$. For more information take a look at the help function for fft in matlab - there should be an argument for specifying your F_s (sampling frequency). $\endgroup$
    – combo
    Commented Feb 1, 2017 at 1:14
  • $\begingroup$ what would be the sampling frequency in my case? I'm sorry. It's my first time doing signal processing. $\endgroup$
    – nhern121
    Commented Feb 1, 2017 at 1:31
  • $\begingroup$ Literally the frequency that your data is taken at. I think you mention it is 1/day in the post ("1 day granularity"). An easier way to think of it is the inverse of the time between measurements (referred to as the sampling period). $\endgroup$
    – combo
    Commented Feb 1, 2017 at 1:33
  • 1
    $\begingroup$ you might like my answer for this other question: stats.stackexchange.com/questions/249198/… $\endgroup$
    – Taylor
    Commented Feb 1, 2017 at 1:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.