Dual Tone Multi Frequency (DTMF) Signal Generation and Detection
Dual Tone Multi Frequency (DTMF) Signal Generation and Detection
Ziynet Pamuk
Sakarya University, [email protected]
Recommended Citation
Pamuk, Nihat and Pamuk, Ziynet, "Dual Tone Multi Frequency (DTMF) signal generation and detection using MATLAB software"
(2015). UBT International Conference. 97.
https://knowledgecenter.ubt-uni.net/conference/2015/all-events/97
This Event is brought to you for free and open access by the Publication and Journals at UBT Knowledge Center. It has been accepted for inclusion in
UBT International Conference by an authorized administrator of UBT Knowledge Center. For more information, please contact
[email protected].
International Conference on Computer Science and Communication Engineering, Nov 2015
Abstract. In this study, Dual Tone Multi Frequency (DTMF) signal generation and detection is
implemented by using Goertzel Algorithm in MATLAB software. The DTMF signals are generated
by using Cool Edit Pro Version 2.0 program for DTMF tone detection. The DTMF signal generation
and detection algorithm are based on International Telecommunication Union (ITU)
recommendations. Frequency deviation, twist, energy and time duration tests are performed on the
DTMF signals. The algorithm recognizes the DTMF tones if they satisfy the recommendations,
otherwise they are rejected.
Keywords: DTMF, Signal Generation and Detection, Goertzel Algorithm, Frequency Deviation
1. Introduction
Dual Tone Multi Frequency (DTMF) is a system of signal tones used in the field of communication
whose application ranges from voice mail and help desks to telephone banking and controlling
robotics designs [1]. The DTMF signal is generated by the sum of two sinusoidal tones. One of them
is selected from a group of 697 Hz, 770 Hz, 852 Hz, 941 Hz named as low frequency group and the
second one is selected from a set of 1209 Hz, 1336 Hz, 1477 Hz, 1633 Hz called high frequency
group. By addition of two sinusoidal tones, four frequencies from each group gives a total of 16
combinations, which represented ten decimal digits, alphabet characters A, B, C, D and two special
characters “*” and “#” [2]. Table 1 shows the frequencies used for each signal.
The signal tones should be detected by using Goertzel Algorithm. [3, 4, 5] have used Goertzel’s
algorithm for the detection of digital DTMF signals. Generating tones for all 16 digits (0 to 9, A to D,
* and #), the Cool-Edit Pro Version 2.0 program is used and the generating tones are used in
MATLAB software for detection. Automatic Gain Control (AGC) is added before detection which
provides the average output signal level is fed back to adjust the gain to an appropriate level for a
range of input signal levels [6]. DTMF detection is implemented by using Goertzel Algorithm and
tests are performed according to standards of International Telecommunication Union (ITU) by using
MATLAB software.
109
International Conference on Computer Science and Communication Engineering, Nov 2015
many applications such as telephone banking, routing customer support calls, system control,
voicemail, and similar applications [8]. A DTMF signal represents one of sixteen touchtone symbols
(0-9, A-D, #, *) as shown in figure 1. Each symbol is represented by one of four frequencies in a low
frequency band and one of four frequencies in a higher frequency band.
In figure 1, the symbols are shown in a matrix format. The columns are represented by frequencies in
a band between 1 kHz (kilohertz) and 2 kHz, and the rows are represented by frequencies in a band
between 500 Hz and 1 kHz. Whenever a key of a touchtone keypad is depressed, the DTMF is
generated by adding two signals and transmitted to device. The device that receives this dual tone
signal must detect which one of the four low frequencies and which one of the four high frequencies
has been received to determine which symbol is to be determined [9].
2S nf1 2S nf 2
y (n) A1 sin( ) A2 sin( ) (1)
Fs Fs
DTMF tones are generated like above equation 1, and f1, f2 frequencies denotes high or low frequency
tone of DTMF respectively. Fs represents sampling frequency.
Goertzel algorithm is used widely and it is most popular method in the worldwide. This algorithm
uses IIR filters that are tuned to eight DTMF frequencies. Direct realization of the goertzel algorithm
is showed in figure 2.
110
International Conference on Computer Science and Communication Engineering, Nov 2015
fk
coeff (k) cos(2.S . ) (4)
fs
The IIR filter coefficient for the second harmonics is found;
2 fk
coeff _ 2nd (k) cos(2.S . ) (5)
fs
where WN-kN = e –j2пk
Once all the row and column filter energies are calculated, a series of tests are executed to determine
the validity of tone and digit results [10], [11]; signal energy, twist, relative peaks, second harmonic,
duration check and frequency deviation.
Signal Energy: The DTMF detection algorithm uses adaptive threshold for the signal energy test.
The signal energy varies with the input signal level. Therefore it is difficult have a fix threshold for
this test. Fix threshold can be only used if the input level is same all the time. Automatic gain control
can be applied to the input.
Twist: Twist is the ratio of low frequency power high frequency power. If the row tone energy is
bigger than the column tone energy, this is known as normal twist. The threshold for the normal twist
is 8 dB (max). If the column tone energy is bigger than the row tone energy, the twist is described as
reverse twist and it can be 4 dB (max) [12], [13].
Relative Peaks: The energy of the strongest signal in each group (row and column tones) is compared
the energies of the rest of the tones in its group. The strongest tone must stand out from the other tones
in its group by a certain ratio [14].
Second Harmonic: The check of second harmonic provides whether the coming signal is DTMF or
speech. Speech has second harmonics, but DTMF signals do not have second harmonics.
Duration Check: According to ITU standards, the duration of DTMF signals should be 40 ms.
Frequency Deviation: The frequency deviation range should be between ± (1.5-3.5) %, where
accepting or rejecting the DTMF tone is up to the designer.
111
International Conference on Computer Science and Communication Engineering, Nov 2015
112
International Conference on Computer Science and Communication Engineering, Nov 2015
In order to verify my MATLAB program, we get the DFT magnitude graph in MATLAB program
and saw that the program works correctly. Figure 6 shows the Goertzel DFT magnitude estimate of
the DTMF signal “7” tone. As can be seen from the figure 6, DTMF “7” tone contains 852 Hz and
1209 Hz sinusoidal. After the one digit is detected by program, we generated more than one DTMF
to be detected by taking buffer whose length is 128. We generated the all DTMF tones
“1234567890*#ABCD”.
After that, we performed the following test; frequency deviation, twist, duration and relative peaks.
We performed the test two times to DTMF. After both of tests are satisfied, we decided whether or
not the DTMF is. After the DTMF is to be recognized twice, we said that DTMF is detected correctly.
The tests are performed by playing string “1234567890*#ABCD” five times. After the tests are
performed on DTMF signals five times, we detected the string “1234567890*#ABCD”. Therefore,
we show that DTMF algorithm works correctly. In second harmonic test, second harmonic energy is
found but second harmonic test is not performed because, we cannot talk off test tape. In the frequency
deviation test, when the frequency range is between ± 1.5 %, algorithm detected correctly. When the
range is selected more than ± 3%, the algorithm failed.
Conclusions
In this study, DTMF signal detection is implemented using MATLAB 7.0 program. The DTMF
signals are generated for each 16 digits in Cool Edit Pro Version 2.0 program. The signals are
strengthened by adding the algorithm of AGC. Then the DTMF detection is done by using Goertzel
Algorithm. For international communication some tests are to be done with the standard of ITU. First
of all the detection and tests are applied for one digit, but later the consecutive DTMF digits detection
113
International Conference on Computer Science and Communication Engineering, Nov 2015
is performed. The DTMF algorithm can be implemented in Simulink and the fixed point code can be
generated from Simulink and it can be used in real time telephony applications.
References
1. Singh, A.K.: Simulation of Dual Tone Multi Frequency Detection Using Bank of Filters,
International Journal of Engineering Research & Technology (IJERT), vol. 2, no. 6 (2013) 750-
755
2. Ravishankar, M.K., Hari, K.V.S.: Performance Analysis of Goertzel Algorithm Based Dual Tone
Multifrequency (DTMF) Detection Schemes, Departmental Technical Report (2004)
3. Mock, P.C.: Add DTMF Generation and Decoding to DSP-mP design, EDN (1985) 205-220
4. Gay, S.L., Hartung, J., Smith, G.L.: Algorithms for Multi-Channel DTMF Detection for the WE
DSP32 Family, International Conference on Acoustics Speech and Signal Processing (ICASSP)
(1989) 1134-1137
5. Bagchi, S., Mitra, S.K.: An Efficient Algorithm for DTMF Decoding Using the Subband NDFT,
International Symposium on Circuits and Systems, (1995) 1936-1939
6. Isaac Martinez, G.: Automatic Gain Control (AGC) Circuits Theory and Design, ECE 1352 Analog
Integrated Circuits-I (Term Paper), University of Toronto (2001) 1-25
7. AN218: DTMF Decoder Reference Design Application Notes, Silicon Laboratories Inc., 4635
Boston Lane, (2005) 1-36
8. Arslan, G., Evans, B.L., Sakarya, F.A., Pino, J.L.: Performance Evaluation and Real Time
Implementation of Subspace Adaptive and DFT Algorithms for Multi Tone Detection, Proc. IEEE
International Conference on Telecommunications, (1996) 884-887
9. US Patent 6608896.: Efficient Digital ITU Compliant Zero Buffering DTMF Detection Using the
Non-uniform Discrete Fourier Transform (2003)
10. Schmer, G.: DTMF Tone Generation and Detection: An Implementation Using the TMS320C54x,
Digital Signal Processing Solutions Application Note, Texas Instruments, SPRA096A (2000) 1-
19
11. Mock, P.: Add DTMF Generation and Decoding to DSP-P Designs, DSP Applications with the
TMS320 Family, vol. 1, Texas Instruments (1989)
12. Edizkan, R.: DTMF Decoder Design for Fixed-Point DSPs (2005)
13. Emiya, V., Lucio, F.C., Vallot, P.D., Melles, D.: Generic Tone Dtection Using Teager-Kaiser
Energy Operations on the Starcore SC140 core (2004)
14. Proakis, J.G., Manolakis, D.G.: DTMF Tone Generation and Detection: An Implementation Using
the TMS320C54x, Digital Signal Processing Solutions Application Report, Texas Instruments,
SPRA096 (1997) 1-56
114