Interpretation of FFT time frequency analysis diagram

In summary, the conversation discusses the use of time frequency analysis, specifically the discrete Fourier transform (DFT) or fast Fourier transform (FFT), to analyze cycles and wave patterns in empirical data. The Python scipy.fftpack library is suggested for this purpose. The resulting frequency analysis graph shows the strength of signals at different frequencies, with the vertical axis representing the signal strength and the horizontal axis representing the frequency in Hz. The function 20*log10 is used to put the signal strength on a logarithmic scale. The lower frequencies appear to be stronger than the higher ones, indicating a correlation or repetitive pattern for values that are more than 4 periods apart. However, this interpretation may be incorrect as it does not match the time series data. The
  • #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)
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()
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...
 

Attachments

  • fftfreq.png
    fftfreq.png
    27.1 KB · Views: 1,041
Physics news on Phys.org
  • #2
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
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 let's 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
eyec said:
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 let's 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)

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

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...
 
  • #5



Hello,

Thank you for sharing your code and the resulting time frequency analysis diagram. From what I can see, your interpretation is mostly correct. The function 20*log_10 does indeed put the signal strength on a logarithmic scale, which is a commonly used scale for visualizing frequency analysis results.

In terms of interpreting the result, it is important to note that the strength of a signal at a particular frequency does not necessarily indicate a correlation or repetitive pattern in the data. It simply shows the strength of that particular frequency component in the data. So, for example, the fact that the lower frequencies (0 to about 0.25) are stronger does not necessarily mean there is a correlation or repetitive pattern for values that are more than 1/0.25=4 periods apart. It just means that those lower frequencies are more prominent in the data.

The downward spikes at certain frequencies are most likely just random influences and do not have any significant meaning. It is important to also consider the overall shape of the frequency analysis diagram and look for any clear patterns or trends that may be present.

Overall, the time frequency analysis diagram can provide valuable insights into the frequency components present in your data, but it is important to interpret the results carefully and consider the limitations of the analysis. I hope this helps clarify your understanding of the diagram. Let me know if you have any further questions.
 

1. What is FFT time frequency analysis diagram?

The FFT (Fast Fourier Transform) time frequency analysis diagram is a visualization tool used to analyze signals in the time and frequency domain. It displays the frequency components of a signal over time, allowing for the identification of periodic patterns or changes in frequency over time.

2. How is the FFT time frequency analysis diagram calculated?

The FFT time frequency analysis diagram is calculated using the Fast Fourier Transform algorithm, which is a mathematical method for converting a signal from its original domain (often time or space) to a representation in the frequency domain. This involves breaking down a complex signal into its individual frequency components.

3. What information can be obtained from the FFT time frequency analysis diagram?

The FFT time frequency analysis diagram can provide information about the frequency components present in a signal, their amplitudes, and how they change over time. This can be helpful in identifying periodic behavior, detecting anomalies or irregularities, and understanding the overall structure of a signal.

4. How can the FFT time frequency analysis diagram be used in scientific research?

The FFT time frequency analysis diagram is a powerful tool for analyzing signals in various fields of scientific research, such as neuroscience, physics, and engineering. It allows researchers to study complex signals and identify important frequency components or patterns that may not be visible in the time domain.

5. Are there any limitations to interpreting the FFT time frequency analysis diagram?

While the FFT time frequency analysis diagram can provide valuable insights into signal behavior, it also has limitations. It assumes that the signal is stationary, meaning its frequency components do not change over time. It also has a limited frequency resolution, which means it may not accurately capture very high or very low frequency components in a signal.

Similar threads

  • General Math
Replies
12
Views
992
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
735
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
5K
  • Electromagnetism
Replies
10
Views
2K
  • Electromagnetism
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
1K
  • Astronomy and Astrophysics
Replies
1
Views
1K
Back
Top