chapter 08
DTMF: history & why it works
The dual-tone scheme wired into every phone keypad, and the deliberate choices that keep it readable through noise and crosstalk.
Before every telephone had a keypad, it had a wheel. To dial a 7 you put a finger in the seventh hole, wound the dial around to the finger stop, and let go. A spring spun it home against a governor, and on the way back a switch broke the line’s direct current seven times, about ten clicks a second. This is pulse dialing, and it is worth pausing on how wonderfully mechanical it is: your finger wound a spring, the spring timed a switch, and the switch was the message. At the exchange, electromechanical steppers counted the clicks and physically ratcheted your call one stage closer to its destination.
It had two problems. The first was speed: zero cost ten pulses, so a long number meant ten-plus seconds of winding and whirring. The second was fatal. The clicks are not sound; they are the line itself switching off and on, and that only means anything across one continuous loop of copper between your dial and the switch. By the late 1950s the network was outgrowing exactly that. Calls rode amplifiers, frequency-multiplexed carriers, microwave hops, and — soon — computer-controlled exchanges, and the interrupted-current trick dies at the first amplifier it meets. Across all of it, only one thing is guaranteed to survive end to end, because carrying it is the network’s entire job: audio in the voice band, roughly 300–3,400 Hz.
Bell Labs’ answer was to move dialing into the voice band itself. If the network can carry your voice, it can carry your dialing as sound. They demonstrated it at the 1962 World’s Fair in Seattle, and in November 1963 it went on sale in two Pennsylvania towns under the trade name Touch-Tone. The scheme underneath is DTMF — dual-tone multi-frequency — and the hard part was never making the sounds. It was choosing them: sounds a machine can detect reliably through noise, hum, and distortion, and that a human voice or a burst of hold music will almost never counterfeit. Detector engineers had a word for that failure: talk-off, a decoder tripped by speech. The design that emerged is a fortress against it, three decisions deep.
The first decision: no key is one tone. Every key is two simultaneous tones, one from a low group (697, 770, 852, 941 Hz) and one from a high group (1209, 1336, 1477, 1633 Hz). The groups form a grid — the low tone names the row, the high tone names the column, and row + column is the key. Sixteen symbols from eight oscillators, and a receiver that demands exactly one tone from each group at the same instant, which no single whistle, hum, or note can satisfy. The fourth column, A–D, never reached home telephones, but it is in the spec, and on this manual’s keypads.
(1) the grid · low group × high group
(2) harmony check · 0–3.5 kHz
press a key — its byproducts appear below the axis
(1) row + column names the key: press one to hear its pair · (2) the eight nominals as ticks, and the pressed pair’s byproducts — doubled tones, tripled low tone, their sum — as diamonds. The 1963 plan guarantees every diamond lands in a gap: this is the arithmetic that rejects voices, whose harmonics are integer-related.
The fourth column’s day job was military. On AUTOVON, the U.S. armed forces’ telephone network, A through D marked a call’s precedence — up to Flash Override, which could seize trunks from any call beneath it. AUTOVON was retired decades ago; the four tones outlived the network they were built for, and every full DTMF decoder still recognizes them.
The arithmetic that rejects voices
The second decision is the quiet masterpiece, and the figure above lets you check it. Chapter 04 showed that nearly everything with a pitch (a voice, a plucked string, hold music) is a harmonic stack: energy at a fundamental and at its integer multiples. The eight DTMF frequencies were chosen to be inharmonic: none is an integer multiple of another, and for any valid pair, the byproducts a real-world source or an overdriven line would add — the doubled and tripled tones, and their sum — fall between the nominals instead of on them, never closer than about 58 Hz. Press keys in FIG. 1 and watch the markers thread the gaps.
Turn that around and it becomes a filter. A hummed note puts its energy exactly on integer multiples of one fundamental, and there is no plausible fundamental whose harmonics land on, say, 770 and 1336 Hz at once; their ratio is 1.735, stubbornly non-integer, like every other ratio in the plan. So requiring a non-integer-related pair is voice rejection built out of arithmetic: no extra circuitry, just number theory hiding in the choice of eight numbers.
The third decision covers everything arithmetic can’t. A valid digit must persist: the standards require a tone to hold for roughly 40 ms before it counts. The two tones must also arrive within a few dB of each other, a quantity with the delightful name twist, needed because the network attenuates high and low frequencies unequally. This project’s recognizer implements the same rulebook: DEFAULT_DTMF_OPTIONS in @sonoglyph/plugin-dtmf accepts tones within ±2% of nominal (ITU-T Q.24 requires accepting ≤1.5% and rejecting ≥3.5%, so 2% sits between), demands 40 ms of persistence, and rejects pairs whose twist exceeds 12 dB. A vowel might light up a plausible pair for a single frame; it almost never holds one steady, level, and alone for 40 ms. Turning those per-frame matches into one clean key press, through debouncing and gap handling, is the segmentation machinery from chapter 07.
Sixty years in the band
Here is the payoff for living in the voice band: DTMF traverses anything that carries audio at all. Copper pairs, digital trunks, a cell call, a VoIP codec, a cassette recording, a phone held up to a laptop’s microphone — the tones neither know nor care. The playground’s input panel exploits this directly: start the microphone, open your phone’s keypad (no call needed), hold it near your computer, and tap. Each tap plays the same two-tone pair this recognizer decodes, exactly as phones have sent it since 1963. Every “press 1 for…” menu you have ever navigated is this same 1963 signaling, still on duty because in-band signals are immune to what the network becomes.
DTMF is also this project’s reference plugin, and its fingerprints are on the whole pipeline. The low group’s closest neighbors sit only 73 Hz apart (697 → 770), so telling them apart takes real frequency resolution: at 48 kHz, that forces an analysis window of at least 2048 samples — about 23 Hz per bin — chapter 03’s tradeoff, settled by a 1963 frequency plan. And once you notice that the only frequencies you will ever care about are these eight, a question forms: why compute the whole spectrum at all, when you could just ask about eight frequencies? That shortcut has a name, Goertzel, and it is chapter 09.