1Introduction
In EEEN 462 — Analog Communications you analyse signals in the frequency domain: the spectrum of an AM or FM waveform, the bandwidth a channel needs, the interference a transmitter leaks into adjacent channels. The mathematical tool behind every spectrum analyser, software-defined radio (SDR), and digital receiver is the Discrete Fourier Transform (DFT). The problem is cost: a direct DFT of N points needs on the order of N² complex multiplications, which for the sample counts used in practice (thousands to millions) is prohibitive.
The Fast Fourier Transform (FFT) is not a new transform — it is a family of algorithms that compute exactly the same DFT with dramatically fewer operations. The most famous, the radix-2 Cooley–Tukey algorithm published in 1965 by James Cooley and John Tukey, reduces the cost from ~N² to ~N log₂N multiplications. This single algorithm made real-time digital spectral analysis, OFDM (Wi-Fi, 4G, 5G), digital demodulation, and modern SDR receivers computationally feasible.
A brief history
| Year | Milestone |
|---|---|
| 1805 | Carl Friedrich Gauss (unpublished) uses an FFT-like method to interpolate asteroid orbits — the algorithm predates the DFT itself by 160 years. |
| 1965 | Cooley & Tukey publish the radix-2 decimation-in-time FFT in Mathematics of Computation; the computer era adopts it immediately. |
| 1967 | Bergland extends to radix-4, radix-8 and mixed-radix algorithms. |
| 1997 | FFTW ("Fastest Fourier Transform in the West") — self-optimising library used in MATLAB, Python and most scientific computing. |
| Today | Every spectrum analyser, SDR, LTE/5G modem (OFDM uses the IFFT/FFT pair), audio codec and medical imaging system relies on it. |
Same mathematics, radically different cost — the FFT removes the redundancy hidden inside the DFT sum.
2Discrete Fourier Transform (DFT) — A Quick Recap
2.1 Definition
Given N samples x[n], n = 0,…,N−1, taken at sampling rate f_s, the DFT is:
and the inverse (IDFT) reconstructs the time sequence:
Interpretation: each X[k] is the correlation of x[n] with a complex sinusoid of frequency f_k = k·f_s/N. |X[k]| tells how much of that frequency component is present; ∠X[k] its phase. For real x[n], the spectrum is conjugate symmetric: X[N−k] = X*[k].
2.2 The twiddle factor
The complex exponential appears so often that we give it a name:
The twiddle factor has two crucial properties that the entire FFT is built on:
For N = 8 there are only 4 distinct twiddle values; the other 4 are their negatives — the redundancy the FFT exploits.
2.3 Cost of the direct DFT
Each of the N outputs requires N complex multiplications and N−1 additions ⇒ about N² multiplications. For the modest N = 4096: 16.8 million multiplications — at 1 µs each, ~17 s per transform. A spectrum analyser updating 50 times per second is impossible. Something smarter is needed.
3The FFT — Divide and Conquer
3.1 Splitting the DFT sum
Separate the N-point sequence into its even-indexed and odd-indexed samples:
Substitute n = 2r (even) and n = 2r+1 (odd) into the DFT definition:
Since WN2rk = WN/2rk and WNk factors out of the odd sum:
where Xe[k] and Xo[k] are the N/2-point DFTs of the even and odd subsequences. Now use the symmetry property WNk+N/2 = −WNk to get the upper half of the spectrum for free:
Recursion continues on each half until only 2-point DFTs remain.
3.2 How many levels?
Each split halves the problem size: N → N/2 → N/4 → … → 2. Starting from N = 2m, exactly m = log₂N levels of recursion are needed. This logarithm is where the FFT's speed comes from.
4The Butterfly Operation
The butterfly is the atomic unit of the FFT: the combine step for each k.
V = a − WNk·b
The crossing lines resemble a butterfly's wings — hence the name. Note the minus sign comes from Wₙ^(k+N/2) = −Wₙᵏ.
4.1 Why is the butterfly so cheap?
| Operation per butterfly | Count |
|---|---|
| Complex multiplications | 1 (the twiddle Wₙᵏ·b) |
| Complex additions | 2 (a + product, a − product) |
| Trivial twiddles | At k = 0 and k = N/2, Wₙᵏ = ±1 — multiply can be skipped |
5FFT Algorithm Steps (Radix-2 Decimation in Time)
Step 1 — Check the length
Radix-2 requires N = 2m (pad with zeros if necessary). Mixed-radix libraries handle other sizes.
Step 2 — Bit-reversal permutation
Recursively taking even/odd samples reorders the input. The required order is the bit-reversed index: write n in binary with log₂N bits, reverse the bits, and place x[n] at that position.
| Index n (decimal) | Binary (3 bits) | Bit-reversed | FFT input position |
|---|---|---|---|
| 0 | 000 | 000 | 0 |
| 1 | 001 | 100 | 4 |
| 2 | 010 | 010 | 2 |
| 3 | 011 | 110 | 6 |
| 4 | 100 | 001 | 1 |
| 5 | 101 | 101 | 5 |
| 6 | 110 | 011 | 3 |
| 7 | 111 | 111 | 7 |
Straight-through for indices 0 and 7; the rest swap in mirrored pairs (1↔4, 2↔2 stays, 3↔6, 5↔5 stays).
Step 3 — Build butterflies, level by level
Starting from adjacent pairs (spacing 1), apply butterflies with progressively wider spans and the twiddles of the corresponding size. Each level l uses W2lk.
| Level | Butterfly span | Twiddles used | Number of butterflies |
|---|---|---|---|
| 1 | 1 (adjacent) | W₂⁰ = 1 only | N/2 |
| 2 | 2 | W₄⁰, W₄¹ | N/2 |
| 3 | 4 | W₈⁰…W₈³ | N/2 |
| … | … | … | N/2 |
| log₂N | N/2 | WN⁰…WNN/2−1 | N/2 |
Step 4 — Full 8-point flow graph
log₂8 = 3 levels × 4 butterflies = 12 butterflies ⇒ 12 complex multiplies vs 64 for the direct DFT.
Step 5 — Worked example (N = 4)
Let x[n] = [1, 1, 0, 0]. Bit-reversed order: [x[0], x[2], x[1], x[3]] = [1, 0, 1, 0].
Level 2 (combine with W₄⁰=1, W₄¹=−j): X[0] = 1 + 1·1 = 2; X[1] = 1 + (−j)(1) = 1 − j;
X[2] = 1 − 1·1 = 0; X[3] = 1 − (−j)(1) = 1 + j ✓ (matches the direct DFT)
6Computational Complexity: DFT vs FFT
| N | DFT multiplies (N²) | FFT multiplies ((N/2)·log₂N) | Speed-up |
|---|---|---|---|
| 8 | 64 | 12 | 5.3× |
| 64 | 4,096 | 192 | 21× |
| 1,024 | 1,048,576 | 5,120 | 205× |
| 4,096 | 16,777,216 | 24,576 | 683× |
| 1,048,576 (2²⁰) | 1.1 × 10¹² | 10,485,760 | ≈ 105,000× |
The gap widens without bound: every doubling of N multiplies DFT cost by 4 but FFT cost only by ~2.
7Implementing the FFT
7.1 From scratch in Python (educational version)
import numpy as np
def fft(x):
"""Recursive radix-2 DIT FFT. Length must be a power of 2."""
x = np.asarray(x, dtype=complex)
N = len(x)
if N == 1:
return x
if N % 2: # radix-2 needs N = 2^m
raise ValueError("N must be a power of 2")
even = fft(x[0::2]) # decimate: even samples
odd = fft(x[1::2]) # decimate: odd samples
k = np.arange(N // 2)
W = np.exp(-2j * np.pi * k / N) # twiddles W_N^k
return np.concatenate([even + W * odd,
even - W * odd])
# Test: compare against numpy
x = [1, 1, 0, 0]
print(fft(x)) # [2, 1-1j, 0, 1+1j] ✓
print(np.fft.fft(x)) # identical
7.2 Production code — never reinvent the wheel
# Python / NumPy (FFTW under the hood in SciPy) import numpy as np X = np.fft.fft(x) # forward FFT x = np.fft.ifft(X) # inverse FFT mag = np.abs(X[:N//2]) # single-sided magnitude spectrum freqs = np.fft.fftfreq(N, d=1/fs)
% MATLAB / Octave X = fft(x); % forward FFT x = ifft(X); % inverse FFT f = (0:N-1)*(fs/N); % frequency axis plot(f(1:N/2), abs(X(1:N/2)))
// C with FFTW (de-facto standard library) #include <fftw3.h> fftw_complex *in, *out; fftw_plan p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE); fftw_execute(p); // out[] now holds the DFT fftw_destroy_plan(p);
7.3 Try it live — in-browser FFT demo
Left: time-domain samples. Right: single-sided magnitude spectrum |X[k]| computed by a radix-2 FFT implemented in JavaScript in this page — the same algorithm described above.
8Applications of the FFT
Directly in EEEN 462 topics
- Spectrum analysers: the displayed trace is |FFT|² of the digitised input, updated in real time thanks to the FFT.
- AM/FM lab work: the frequency-spectrum plots in your virtual labs are FFTs of the simulated waveforms — verifying sideband structure and Carson bandwidth.
- SDR receivers: the mixer + low-pass + FFT chain replaces analogue filters; stations appear as peaks in the spectrum.
- Distortion measurement: THD and intermodulation products read off an FFT of the amplifier output.
Modern communications & beyond
- OFDM / OFDMA (Wi-Fi, LTE, 4G/5G): the transmitter uses the IFFT to synthesise subcarriers, the receiver uses the FFT to separate them — millions of FFTs per second per device.
- Channel sounding & equalisation: FFT/IFFT convert between the time-domain channel impulse response and frequency response.
- Radar & sonar: pulse compression (matched filtering) and Doppler processing are FFT-based.
- Audio & image compression: MP3, AAC and JPEG operate on frequency-domain coefficients obtained by FFT-like transforms.
- Medical & scientific imaging: MRI reconstruction is fundamentally an FFT.
What was once racks of analogue filters is now one FFT — the reason your phone can decode Wi-Fi, 4G and 5G in real time.