The Fast Fourier Transform (FFT) is widely regarded as one of the most important algorithms of the 20th century. It decomposes time-domain wave signals (such as audio, radio frequencies, or image textures) into their constituent frequency spectrum components.
While naive Discrete Fourier Transform (DFT) requires complex multiplications, the Cooley-Tukey FFT algorithm uses divide-and-conquer to compute the exact spectrum in time.
1. Summary & Key Takeaways
- Continuous Fourier Transform: Translates continuous time-domain function to frequency spectrum :
- Cooley-Tukey Radix-2 FFT: Splits a size- DFT into two sub-problems of size (even and odd indexed samples):
- Time Complexity Speedup: Reduces computational steps from down to , enabling real-time audio processing and digital communications (5G, Wi-Fi, MP3/JPEG compression).
2. Interactive FFT Signal Decomposition
Use the interactive spectrum analyzer below to adjust the frequencies of two combined sine waves, then view the resulting Time-Domain Waveform and Frequency-Domain FFT Spectrum!
Adjust the Sine Wave 1 and Sine Wave 2 sliders. Watch the lower FFT spectrum graph isolate the two distinct frequency magnitude peaks!
Fast Fourier Transform (FFT) SpectrumSignal Processing
Decompose composite time-domain wave signals into their exact frequency spectrum components!
# Fast Fourier Transform (FFT) in Python using NumPy & SciPy
import numpy as np
from scipy.fft import fft, fftfreq
# 1. Generate Composite Signal (440 Hz + 880 Hz Sine Waves)
sampling_rate = 8000 # 8 kHz
t = np.linspace(0, 1.0, sampling_rate, endpoint=False)
signal = np.sin(2 * np.pi * 440 * t) + 0.5 * np.sin(2 * np.pi * 880 * t)
# 2. Compute Fast Fourier Transform (Cooley-Tukey O(N log N))
fft_spectrum = fft(signal)
frequencies = fftfreq(len(signal), 1.0 / sampling_rate)
# 3. Extract Magnitude Spectrum Peaks
magnitudes = np.abs(fft_spectrum)[:len(signal)//2]3. Mathematical Foundations: Cooley-Tukey Divide-and-Conquer
For discrete sequence , the Discrete Fourier Transform is:
By separating into even () and odd () terms:
where is the twiddle factor!
4. DFT vs. FFT Performance Comparison
| Property | Naive DFT | Cooley-Tukey FFT |
|---|---|---|
| Time Complexity | ||
| Steps for () | operations | operations ( faster!) |
| Real-Time Feasibility | ❌ Too slow for live audio/telecom | ✅ Real-time 4K audio, 5G, & JPEG |