Summary of What is Dual ToneMultiple Frequency (DTMF)
DTMF (Dual Tone Multiple Frequency) generates unique signals by combining row and column frequencies when telephone keypad buttons are pressed. Each key produces two specific tones, such as 770 Hz and 1336 Hz for the '5' button. The article outlines ANSI standards for tone duration, silence intervals, and signal strength, while listing specific chips used for encoding and decoding these signals in telephony applications.
Parts used in the DTMF Telephony Project:
- TP5089 DTMF Generator
- MT8870DE DTMF Decoder
DTMF, dual-tone multi-frequency signalling, is the pair of tones a phone keypad sends when you press a key. Each key adds one tone from a low group (its row) and one from a high group (its column), and a receiver identifies the key by finding the two tones. This page lists the frequencies, explains how decoding works and gives an Arduino sketch that detects keys with the Goertzel algorithm.
- There are four row tones (697, 770, 852 and 941 Hz) and four column tones (1209, 1336, 1477 and 1633 Hz).
- Pressing 5 sends 770 Hz and 1336 Hz together.
- A decoder chip such as the MT8870 does the detection in hardware; a microcontroller can do it in software.
- The Goertzel algorithm measures only the eight frequencies you care about, so it is much cheaper than a full FFT.

Frequency table
| 1209 Hz | 1336 Hz | 1477 Hz | 1633 Hz | |
|---|---|---|---|---|
| 697 Hz | 1 | 2 | 3 | A |
| 770 Hz | 4 | 5 | 6 | B |
| 852 Hz | 7 | 8 | 9 | C |
| 941 Hz | * | 0 | # | D |
The fourth column (A to D) is used mainly in special systems; an ordinary phone keypad has only the first three columns. The groups were chosen so that no tone is a multiple of another, which reduces false detection from speech and music.
How a receiver finds the tones
| Method | How it works | Good for |
|---|---|---|
| Decoder chip (for example MT8870) | Filters and decodes in hardware and gives a 4-bit code | Simplest; no code |
| Goertzel in software | Computes the power at each of the eight frequencies over a block of samples | Microcontrollers with a few kilobytes of RAM |
| FFT | Computes all frequencies at once | Needs more memory and time than a small AVR has to spare |
The Goertzel algorithm runs a small filter for each frequency of interest. For a block of N samples at sample rate fs, the coefficient for frequency f is 2 x cos(2 x pi x f / fs). With fs = 8000 Hz and N = 205 each bin is about 39 Hz wide, which separates the closest pair of tones (852 and 941 Hz). After N samples the sketch compares the power in the four row filters and the four column filters, picks the strongest of each and decides the key.
Arduino sketch
// atmega32-avr.com
// DTMF tone detector for an Arduino Uno using the Goertzel algorithm. Audio from a decoder-less source
// (for example an amplified microphone or phone line interface) biased to mid-supply, on A0.
const int N = 205; // samples per block; at 8 kHz each bin is about 39 Hz wide
const float FS = 8000.0; // target sample rate in Hz
const float rowF[4] = {697, 770, 852, 941};
const float colF[4] = {1209, 1336, 1477, 1633};
const char keys[4][4] = {{'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'}};
float coeff[8];
int samples[N];
float goertzel(float c) { // returns the power at the frequency whose coefficient is c
float q0, q1 = 0, q2 = 0;
for (int i = 0; i < N; i++) {
q0 = c * q1 - q2 + samples[i];
q2 = q1;
q1 = q0;
}
return q1 * q1 + q2 * q2 - c * q1 * q2;
}
void setup() {
Serial.begin(115200);
for (int i = 0; i < 4; i++) {
coeff[i] = 2.0 * cos(2.0 * PI * rowF[i] / FS);
coeff[i + 4] = 2.0 * cos(2.0 * PI * colF[i] / FS);
}
}
void loop() {
unsigned long period = (unsigned long)(1000000.0 / FS);
long sum = 0;
for (int i = 0; i < N; i++) { // note: analogRead takes about 100 us at the default ADC clock, so 8 kHz is just reachable
unsigned long t = micros();
samples[i] = analogRead(A0) - 512;
sum += samples[i];
while (micros() - t < period) { }
}
float p[8];
int bestRow = 0, bestCol = 0;
float rowMax = 0, colMax = 0, total = 0;
for (int i = 0; i < 8; i++) {
p[i] = goertzel(coeff[i]);
total += p[i];
}
for (int i = 0; i < 4; i++) {
if (p[i] > rowMax) { rowMax = p[i]; bestRow = i; }
if (p[i + 4] > colMax) { colMax = p[i + 4]; bestCol = i; }
}
if (rowMax > 2e6 && colMax > 2e6 && rowMax + colMax > 0.6 * total) { // both tones strong and dominant
Serial.println(keys[bestRow][bestCol]);
}
}
Feed the audio to A0 through a coupling capacitor and a divider that biases the signal to about half the supply, so the samples centre near 512. The analogue read takes about 100 microseconds at the default ADC clock, so 8 kHz is just reachable on an Uno; if the sample timing slips, the tones appear at the wrong frequencies. The power threshold (2e6) is a starting point: print the eight powers with a known tone and set it to suit your signal level.
If keys are missed or wrong
| What you see | What to check |
|---|---|
| Nothing is detected | Signal level too low or the bias is not near mid-supply; lower the threshold. |
| Wrong digits | Sample rate is not 8 kHz; check the timing and the ADC clock. |
| False digits from speech | Raise the threshold and require the same key in two blocks in a row. |
| Misses short tones | A block takes about 26 ms (205 samples at 8 kHz); tones shorter than that are missed. |
Quick answers
More from this site
- Fast PWM on AVR: build a tone generator
- I2C on AVR: another bus for your project
- USB connector pinout: more interface reference
Downloads and references
- 💾 Arduino code (dtmf-goertzel-code.zip)
dtmf_goertzel.ino.
Quick Solutions to Questions related to DTMF Telephony:
- How does a telephone keypad generate a signal?
Pressing a button connects a row frequency and a column frequency to create a resultant Dual Tone Multiple Frequency signal. - What is the minimum duration required for a DTMF tone?
ANSI standards state that the DTMF duration must be at least 50ms. - How many distinct tones are used for each key?
Two tones are used to represent each key on the touch pad. - What frequencies are generated when pressing the number 5?
Pressing the number 5 generates tones of 770 Hz and 1336 Hz. - What represents the asterisk and hash keys in this system?
The number 10 represents the asterisk key and 11 represents the hash key. - What is the minimum silence interval between digits?
The inter-digit interval or silence between tones must be at least 45ms. - Which chip is used to encode DTMF signals?
The TP5089 DTMF Touch-Tone Generator chip is used to encode the signals. - Which chip is used to decode DTMF signals?
The MT8870DE DTMF decoder chip is used to decode the signals.
