1
\$\begingroup\$

Based on what I've read about Fourier Transforms, it seems that they are designed to work on waves whose components are constant. For example, a simple square wave is

\$\sin(\theta) + 1/3sin(3\theta) + 1/5sin(5\theta)+ 1/7sin(7\theta)\$

However, there are times when a Fourier Transform is used to compute a spectrogram for a file such as a song in which the frequencies that the instruments are playing often change or disappear completely. How does a Fourier Transform know that a given frequency does not exist for a certain period of time? Does it have to break the file down into components and analyze each of those? The presence of time, frequency, and amplitude on a spectrogram suggests that it works, but I don't fully understand how. Thanks in advance for your help.

\$\endgroup\$
  • \$\begingroup\$ There is always a trade-off between how much time vs. frequency resolution, which is primarily determined by the number of samples in each block of your FFT. The more samples in each block, the more frequency resolution you have (your resulting FFT has more bins), but the trade-off is more time smearing, since the block represents a longer length of signal at the sampling rate. If you think of a spectrogram as an image with X being time and Y being frequency, there is always a trade-off between how many X "pixels" you have vs. how many Y "pixels" you have for a given length of signal. \$\endgroup\$ – Zuofu Aug 9 '15 at 19:38
1
\$\begingroup\$

To create a spectrogram, a signal (e.g audio) is split into segments and then the FFT of each of those segments is computed and then the individual amplitude spectrums of those segments are put side by side.That is why with a spectogram you have both time and frequency components.You might want to see the diagram in THIS post so you can visualise how a spectrogram is produced.

\$\endgroup\$
  • \$\begingroup\$ That was really helpful, thanks! That also makes the concept of Window Functions make more sense \$\endgroup\$ – Ryan Aug 10 '15 at 22:13
0
\$\begingroup\$

Because the FFT is happening at Sample Rate (in kHz) / 2 (Called the Nyquist Rate), for an accurate representation of the signal. It is not a one time thing. You are Sampling the signal continuously, tracking the changes from one point to another.

See Wikipedia: Sampling for more info.

\$\endgroup\$
0
\$\begingroup\$

You may want to consider something like Wavelet analysis. Essentially it does a "local" fourier analysis for cases where at certain points in time of a trace, the frequency components can change.

\$\endgroup\$
  • \$\begingroup\$ That sounds interesting, I'll look into that. In a comment above, someone mentioned the FFT having a tradeoff between time and frequency resolution. Do you know if there is a similar tradeoff with Wavelet analysis or if there is an advantage of FFT over Wavelet? Thanks for your help! \$\endgroup\$ – Ryan Aug 10 '15 at 22:17
  • \$\begingroup\$ Yes that tradeoff still exists. So when you have a signal that is not stationary (you may not know when or where the change in the signal occurs, some abrupt transients or trends) is the time you would prefer a wavelet transform over a fourier transform (where the frequencies are constant and unchanging in time). \$\endgroup\$ – cowboydan Aug 11 '15 at 1:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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