2
$\begingroup$

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.

plot(fft(data))

What am I doing wrong?

$\endgroup$
4
  • 2
    $\begingroup$ Try the square of the absolute value of the FFT. $\endgroup$ Feb 23, 2010 at 21:53
  • $\begingroup$ 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. $\endgroup$ Feb 24, 2010 at 0:03
  • 1
    $\begingroup$ 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) $\endgroup$
    – user2734
    Feb 24, 2010 at 7:58
  • $\begingroup$ 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. $\endgroup$
    – kakaz
    Feb 24, 2010 at 8:46

2 Answers 2

3
$\begingroup$

Why don't you try autocorrelation?

See Wikipedia:

http://en.wikipedia.org/wiki/Autocorrelation

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."

$\endgroup$
0
$\begingroup$

Hi,

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.

$\endgroup$

Your Answer

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

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