A deep dive into the Cooley-Tukey Fast Fourier Transform (FFT) algorithm, explaining how it achieves O[NlogN] complexity versus the naive O[N²] DFT. Covers the mathematical symmetries that make the divide-and-conquer approach possible, then walks through three Python implementations: a slow DFT using matrix multiplication, a recursive FFT, and a vectorized NumPy version. Benchmarks show the vectorized version comes within a factor of 10 of FFTPACK, using only a few dozen lines of Python.

10m read timeFrom jakevdp.github.io
Post cover image

Sort: