Apex › Storage & databases

How a phone hears touch-tones (Goertzel)

When you only need a few specific frequencies — not the whole spectrum — a full FFT is overkill. The Goertzel algorithm computes a single DFT bin with a tiny two-tap recursive filter tuned to resonate at that frequency, at O(N) per bin instead of the FFT’s O(N log N) for all N. It’s how a phone decodes touch-tones: each key is two tones (a row + a column), and seven cheap detectors read them off. Verified: Goertzel equals the DFT bin to the last digit. Press a key and watch the bank light up.

More in Storage & databases