Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the periodicity in data?

I have a dataset (an array) and I need to find the periodicity in it. How should I proceed? Somebody said I can use FFT but I am not sure how will it give me the periodicity. Your help is appreciated!

like image 581
Michael Avatar asked Nov 21 '10 18:11

Michael


2 Answers

For this task it's best to use the autocorrelation.

The FFT is the wrong tool to use for finding the periodicity.

Consider, for example, a case where your waveform is made by adding together two simple sine waves, one with a period of 2 seconds (0.5 Hz), and the other with 3 seconds (0.333 Hz). This waveform will have a periodicity of 6 seconds (i.e., 2*3), but the Fourier spectrum will only show two peaks at .5 Hz, and .333 Hz.

like image 67
tom10 Avatar answered Oct 22 '22 21:10

tom10


Periodicity is not well defined term. For example, such data:

1, 10, 1, 10, 1, 11, 1, 10, 1, 10, 1, 11, 1, 10, 1, 10, 1, 11

you may treat as one with not exact but strong periodicity of 2, and as exact periodicity of 6.

For exact periodicity you may simply try to find given data as substring of data repeated twice.

For non exact periodicity of real, noisy signal time domain and frequency domain methods may be used.

Time domain one is self correlation. It is like a substring search above: searched for a shift value on which data have maximum self similarity.

For simple signals counting threshold transitions may be enough.

Frequecy domain methods include one using FFT/FHT: search for a maximum in fequency spectre which gives 1/T of periodicity.

Another method is using Cepstrum.

like image 42
Vovanium Avatar answered Oct 22 '22 22:10

Vovanium