I have some time series datasets which are periodic, and I'd like to pick out the fundamental frequency of the data and take the average over a fundamental period.


1) Would something simple like taking the FFT of the time series data and looking for the strongest peak frequency do the trick, or are there more complicated period detection algorithms out there? For what it's worth, I'm trying to do all this in MATLAB.

2) There are some edge effects, particularly at the beginning of each data set. Would I have to take this into account?

  • $\begingroup$ "taking the FFT of the time series data and looking for the strongest peak frequency do the trick" Nope. the strongest peak could be different from the fundamental. In fact, the fundamental might not even be there. gist.github.com/255291 $\endgroup$ – endolith Jul 17 '12 at 19:10
  • $\begingroup$ Can you put up a plot of the type of periodic signals you are looking to get periodicity out of? $\endgroup$ – Spacey Jul 17 '12 at 19:46
  • $\begingroup$ @endolith Curious - how can a periodic signal not necessarily have a fundamental? $\endgroup$ – Spacey Jul 17 '12 at 19:47
  • 2
    $\begingroup$ @Mohammad : Periodic with no fundamental? Easy, take any periodic signal with strong harmonics and subtract the fundamental with a bandpass filter. Deep male voices sent though an old telco circuit are almost exactly like this. $\endgroup$ – hotpaw2 Jul 17 '12 at 19:59
  • 1
    $\begingroup$ In this blog, I show how to create a low frequency pitch (or lowest periodicity) using only high frequency tone bursts: musingpaw.com/2012/04/… $\endgroup$ – hotpaw2 Jul 17 '12 at 20:08

This is essentially the problem of Pitch Detection. A fairly simple approach is to compute the autocorrelation (FFTs can be used to do this quickly), and look for the peak with T > T_min

| improve this answer | |
  • $\begingroup$ Thanks for the suggestion: I've ended up using a Lomb-Scargle MATLAB script. $\endgroup$ – Kris Jul 17 '12 at 19:56

The strongest peak of an FFT is only good at periodicity estimation if you can absolutely guarantee that the fundamental frequency has more power than any overtone or harmonic. This is not true for many types of phenomena that are periodic. But if it is true, then windowing can help reduce edge effects.

However, an FFT can be used as part of a more sophisticated periodicity or pitch detection/estimation method, such autocorrelation by fast convolution, or a cepstrum, or a harmonic product spectrum. etc.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.