Multimedia & Machine Learning Algorithms · Multimedia Algorithms
Frequency Domain Processing — DFT, FFT, STFT, and Spectrograms
Explanation
Frequency Domain Processing — Intuition
We are used to thinking of signals as functions of time: "at second the wave is at height ." But we can describe the exact same signal as a sum of sine waves at different frequencies: "the signal consists of a 440 Hz wave (A note), an 880 Hz wave (high A), etc." This description — the frequency domain — is essential for audio/video compression, image processing, and pattern recognition.
DFT — The Discrete Fourier Transform
Given a discrete signal of length (e.g., samples). The DFT (Discrete Fourier Transform) computes its frequency spectrum:
Here and the -th bin represents frequency (in Hz).
Interpretation:
- (the DC component): — sum of all samples.
- — the DFT magnitude (unnormalized) at frequency ; for a real sinusoid of amplitude : , so .
- Symmetry for real signals: For , we have (complex conjugate). Thus the DFT contains non-redundant information only for .
Computational complexity: A direct DFT (from the formula) requires multiplications.
FFT — Fast Algorithm for Computing the DFT
The FFT (Fast Fourier Transform), developed by Cooley and Tukey in 1965, computes the exact same DFT but in only operations for a power of 2.
Speedup factor:
For example, for : DFT requires operations, FFT requires — 102 times fewer.
STFT — Time-Frequency Analysis
A regular DFT gives the spectrum of the whole signal at once, but does not show when each frequency appears. The STFT (Short-Time Fourier Transform) solves this: compute the DFT over short windows that slide across the signal:
Here is a window function (Hann, Hamming, rectangular), is the window length, and is the hop size between windows.
Time-frequency resolution trade-off (Heisenberg uncertainty): Longer windows give better frequency resolution but worse time resolution, and vice versa. The spectrogram is a visual display of as a function of time () and frequency ().
Frequency resolution between bins:
Interactive Visualization
Loading visualization
Worked Examples
Practice
Exercise 1 of 6
1
What is the (DC) component of the DFT of any signal ?
★Quiz
Test your knowledge from this lesson
A mix of questions from the lesson — each attempt varies slightly
Answer at least 4 out of 5 questions correctly to pass (70%)