# Homework Help: Interpretation of FFT time frequency analysis diagram

1. Aug 8, 2012

### eyec

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)
Code (Text):

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()

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

#### Attached Files:

• ###### fftfreq.png
File size:
46.5 KB
Views:
438
2. Aug 10, 2012

### rude man

Do you understand Fourier series? In doing a DFT or FFT you are taking your data set, pretending it repeats ad infinitum, so that the lowest frequency you can detect = 1/(length of your data stream). This lowest frequency is your lowest frequency "bin". You then compute the magnitudes of all harmonics of that lowest frequency, putting each harmonic amplitude in its respective bin (you will get zero for all bins greater than the greatest freuency component in your data stream).

The formula 20log10 is the amplitude of each frequency component expressed in decibels, abbreviated dB. Yes, it's a logarithmic measure of magnitude which you will understand better if and when you start to deal with networks, transfer functions, gain accumulation, etc.

Your data is indicative of a rolling-off in frequency like you might get with a simple R-C network: resistor from input to output, capacitor from output to ground. The horizontal line has no meaning per se. The "negative" spikes are not negative, just smaller than the "positive" ones.

3. Aug 14, 2012

### eyec

thanks rude man,

I wouldn't say I understand Fourier series, but I like to think I'm trying to. (and I believe I roughly understand how DFT works, that the results of FFT are the same as those of DFT, what the bins are, that the highest measurable frequency is the density of measurements and the lowest identifyable freqency that of a signel period of the length of the entire datastream)

but I have to admit that I never have heard of a R-C network - I'll read into that; maybe then I understand a little bit more about what kind of data I am dealing with.

still there are some things I find odd about that time frequency analysis. consider for instance a datastream (or lets say a stream of measured values), all values within the range (0,10), maybe even random data. Changing a single value significantly (to a new value of, say 1000) will change the frequency pattern you obtain by FFT completely. doesn't that mean that a single measurement error may lead to a number of wrong conclusions as it yields a completely different time frequency pattern?

(and never mind the horizontal line. it's there because pylab plot starts drawing at 0, connecting each subsequent point with the previous one with a line. and when it reaches the highest positive frequency, it continues with the negative one connecting the two ... a scatter plot would probably have been more appropriate)

4. Aug 14, 2012

### rude man

You absolutely need to understand Fourier series first. It's not at all obtuse and it's very enlightening. The DFT and FFT are fully understandable from the series alone. (Fourier and Laplace integral transforms come later and are more subtle.)

"RC network" as I meant it: take a resistor R, input signal at first end and output at second end. Capacitor C: connect first end to R second end, and C second end to ground. Apply your signal across R first end and ground, take output signal across C. Sorry I don't provide a figure, I'm not up on that fancy stuff ...

In theory, if you all of a sudden get a datum of '1000' it will show up in the spectrum, but only as a very small (high frequency) component.

In real life, your data stream originates in analog form, say, as a voltage. This voltage stream is sampled (digitized) ever so many microseconds or whatever. So if the sampler happens to miss that "1000" spike it will not be present in the spectrum if it isn't wide enough.

If your data is already in digital form then the "1000" datum will show up in the spectrum as a small, high-frequency component, but its significance referred to the original analog stream depends on whether or not the data was sampled sufficiently fast.

We could go into all sorts of details about aliasing, required sampling frequencies, subsequent reconstruction low-pass filters, etc. etc. but this is probably enough food on your plate for one meal...

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook