DTMF Generator and Receiver
This example shows how to model a dual-tone multifrequency (DTMF) generator and receiver. The example includes a preconfigured model that has a bandpass filter bank receiver, a spectrum analyzer block displaying a spectrum and spectrogram plot of the generated tones, a shift register to store the decoded digits, and a real-time soundcard audio on all platforms.
DTMF signaling uses two tones to represent each key on the touch pad. The touch pad has four rows and three columns, for a total of 12 keys. Pressing a key generates a row tone and a column tone according to this table.
1209 Hz 1336 Hz 1477 Hz
697 Hz 1 2 3 770 Hz 4 5 6 852 Hz 7 8 9 941 Hz * 0 #
For example, pressing the 5 key generates the tones 770 Hz and 1336 Hz.
The row and column frequencies in this example avoid harmonic ambiguity. No frequency is a multiple of another. The difference between any two frequencies does not equal any of the other frequencies, and the sum of any two frequencies does not equal any of the other frequencies.
In this example, the * key represents the number 10 and the # key represents the number 11.
The receiver detects the tone frequencies and decodes the number. You can use a DFT-based algorithm to detect the frequencies. However, since there are only seven frequency components in this example (four low frequencies and three high frequencies), it is more efficient to use the Goertzel algorithm. This algorithm detects the frequency components by passing the received signal through seven bandpass filters. You can adjust the filter bandwidths as a percentage of the center frequency in the DTMF Receiver block.
Open and run the model
When you run the simulation, you can view the spectrogram of the tone received by the DTFM receiver in the scope. You can view the numbers detected by the DTFM receiver in the numeric display scope. If you use the version of the model designed for audio hardware, you can listen to the received tone through the system sound card.
You can adjust the following model parameters:
Frequency bias for each tone (DTMF Generator block)
Channel noise power and signal gain (Channel block)
Receiver bandpass filter frequency bandwidth (DTMF Receiver block).