- #1
eyec
- 6
- 0
Hi,
I was told that in order to analyze cycles, wave patterns etc in empirical data, the time frequency analysis using the discrete Fourier transform (or the fast Fourier transform) are most appropriate (instead of say the autocorrelation spectrum).
Using the Python scipy.fftpack as follows (in the beginning I have two list variables, one containing the time indices, the other one containing the empirical data for those time indices)
gives me the figure attached below. The upper graph shows the data, the lower graph the frequency analysis. The frequency is on the horizontal axis ... and if the timesteps were given in seconds, this frequency would be in Hz. In any case each frequency value gives the strength of a signal of period = 1/frequency.
What I do not understand is how the signal strength (vertical axis) is to be interpreted. The function 20*log_10 applied to these values was recommended somewhere - I guess it just puts the signal strength (vertical axis) on a logarithmic scale. Is that correct?
Further, how can I interpret the result? There do not appear to be any strong patterns for any frequency except the 0-frequency. Does this mean, its just noise with no regular signal?
The lower frequencies (0 to about 0.25) seem to be stronger than the higher ones. Does this mean that there is a correlation or repetitive pattern for values that lie more than 1/0.25=4 periods apart while there is none for shorter periods and immediately neighboring values? (This interpretation seems odd and does not reflect what is seen in the time series (upper figure), thus, I guess its probably wrong?)
I guess the downward spikes (at frequency 0.03 for instance) are just random influences as well and do not mean anything. Is that correct?
Sorry if these questions seem obvious; any help appreciated; thanks...
I was told that in order to analyze cycles, wave patterns etc in empirical data, the time frequency analysis using the discrete Fourier transform (or the fast Fourier transform) are most appropriate (instead of say the autocorrelation spectrum).
Using the Python scipy.fftpack as follows (in the beginning I have two list variables, one containing the time indices, the other one containing the empirical data for those time indices)
Code:
import numpy
import scipy
import scipy.fftpack
import pylab
time=numpy.asarray(time)
data=numpy.asarray(data)
dataFFT=abs(scipy.fft(data))
dataF=scipy.fftpack.fftfreq(data.size,time[1]-time[0])
pylab.subplot(211)
pylab.plot(time,data)
pylab.subplot(212)
pylab.plot(dataF,20*scipy.log10(dataFFT))
pylab.show()
What I do not understand is how the signal strength (vertical axis) is to be interpreted. The function 20*log_10 applied to these values was recommended somewhere - I guess it just puts the signal strength (vertical axis) on a logarithmic scale. Is that correct?
Further, how can I interpret the result? There do not appear to be any strong patterns for any frequency except the 0-frequency. Does this mean, its just noise with no regular signal?
The lower frequencies (0 to about 0.25) seem to be stronger than the higher ones. Does this mean that there is a correlation or repetitive pattern for values that lie more than 1/0.25=4 periods apart while there is none for shorter periods and immediately neighboring values? (This interpretation seems odd and does not reflect what is seen in the time series (upper figure), thus, I guess its probably wrong?)
I guess the downward spikes (at frequency 0.03 for instance) are just random influences as well and do not mean anything. Is that correct?
Sorry if these questions seem obvious; any help appreciated; thanks...