MathOverflow is a question and answer site for professional mathematicians. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some real data (data packets in a router). When I plot it I can see there is a clear periodicity on the dataset (24hours+-).

But how can I discover the periodicity of the data without being by approximation, and possible check other periodicities?

What I am trying to do:

I thought I just had to do the the Fourier transform and then see what were the higher frequencies (one should be around 24).

When I do this in octave and then plot the graphic only garbage comes out.


What am I doing wrong?

share|cite|improve this question
Try the square of the absolute value of the FFT. – Steve Huntsman Feb 23 '10 at 21:53
If the period itself varies slightly this might not be accurately reflected in the FFT. You might try shifting around your data so that some particular distinguished peak of activity is always at the same time every day and then try it again. – Qiaochu Yuan Feb 24 '10 at 0:03
Just to emphasize what Steve Huntsman said: You are probably trying to plot complex data. In matlab notation, try to replace plot(fft(x)) by plot(abs(fft(x))), or plot(abs(fft(x)).^2) – user2734 Feb 24 '10 at 7:58
You may also try to plot wavelet transform (Scilab has this functionality ), which in case of non stationary and non filtered (for example do You check and remove trends? is thee some constant background signal in Your data - I presume YES!) data may be much more interesting and informative. It should give You information about frequencies related to certain time intervals ( data in period window of hours may be non-periodic, whilst when averaged on days has to have visible frequencies). Using FFT on non filtered data ( non averaged, trends removed rtc) may give You garbage outputs. – kakaz Feb 24 '10 at 8:46

Why don't you try autocorrelation?

See Wikipedia:

Excerpt: "Autocorrelation is the cross-correlation of a signal with itself. Informally, it is the similarity between observations as a function of the time separation between them. It is a mathematical tool for finding repeating patterns, such as the presence of a periodic signal which has been buried under noise, or identifying the missing fundamental frequency in a signal implied by its harmonic frequencies. It is often used in signal processing for analyzing functions or series of values, such as time domain signals."

share|cite|improve this answer


try following Matlab Tech Notes on proper rescaling/shifting of fft output to get meaningful power spectrum of a signal. Octave seems to be pretty close to Matlab in syntax and basic commands so you shouldn't have too much problem adapting the tutorial to your software.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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