9.5 Fast Fourier transform
Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §9.5. Rewritten in original wording — no textbook code dumps. Continues 9.4c. Next: 9.5b.
Why hurts
The DFT
needs a complex multiply for each pair — about work. At that is the difference between a coffee break and an overnight job. Cooley–Tukey (and earlier rediscoveries) reuse the periodicity of to cut the cost to roughly .
Divide, butterfly, conquer
Split the data into halves, transform each half, combine. Each stage of length costs butterflies; stages . Pick the butterfly map and the bit-reversal consequence among lookalikes.
For , powers of collapse to four independent values ( and sign flips). Grouping before multiplying by removes redundant work — 24 complex multiplies in a staged butterfly network versus 64 in the naive sum.
Bit reversal
With bits, reverse the bits of each index (table below for ).
| dec | bits () | reversed | dec′ |
|---|---|---|---|
| 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 |
Same idea with 4 bits for (first half of reversed indices are even). Production FFTs hide this shuffle; you should still know it exists when comparing hand butterflies to library fft.
Practice stance
Prefer a trusted FFT for production spectra. Implement a tiny radix-2 butterfly / bit-reverse once so the story is visceral — then call libraries. Pair with §9.4 filters: FFT → multiply by → iFFT is the fast convolution route.
FFT
1 / 4Naive DFT cost scales as…
Pick an answer to see if you are right.
Next: 9.5b FFT labs.