0% found this document useful (0 votes)
56 views7 pages

Dual Tone Multi Frequency (DTMF) Signal Generation and Detection

This document describes research on generating and detecting Dual Tone Multi-Frequency (DTMF) signals using MATLAB software. DTMF signals are generated using Cool Edit Pro and detected using the Goertzel algorithm. The Goertzel algorithm is an efficient digital signal processing technique for detecting the presence and amplitude of a discrete frequency component in a digital signal. The document outlines how DTMF signals are generated and the structure of a DTMF keypad. It then describes implementing DTMF signal detection using the Goertzel algorithm in MATLAB, including validity checking of detected signals based on ITU standards. Experimental work is carried out by generating DTMF tones and detecting them to test the performance of the algorithm.

Uploaded by

Da
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views7 pages

Dual Tone Multi Frequency (DTMF) Signal Generation and Detection

This document describes research on generating and detecting Dual Tone Multi-Frequency (DTMF) signals using MATLAB software. DTMF signals are generated using Cool Edit Pro and detected using the Goertzel algorithm. The Goertzel algorithm is an efficient digital signal processing technique for detecting the presence and amplitude of a discrete frequency component in a digital signal. The document outlines how DTMF signals are generated and the structure of a DTMF keypad. It then describes implementing DTMF signal detection using the Goertzel algorithm in MATLAB, including validity checking of detected signals based on ITU standards. Experimental work is carried out by generating DTMF tones and detecting them to test the performance of the algorithm.

Uploaded by

Da
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

University of Business and Technology in Kosovo

UBT Knowledge Center


UBT International Conference 2015 UBT International Conference

Nov 7th, 9:00 AM - 5:00 PM

Dual Tone Multi Frequency (DTMF) signal


generation and detection using MATLAB software
Nihat Pamuk
Turkish Electricity Transmission Company, [email protected]

Ziynet Pamuk
Sakarya University, [email protected]

Follow this and additional works at: https://knowledgecenter.ubt-uni.net/conference


Part of the Computer Sciences Commons, and the Digital Communications and Networking
Commons

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

Dual Tone Multi Frequency (DTMF) signal generation and


detection using MATLAB software

Nihat Pamuk1, Ziynet Pamuk2


1
Turkish Electricity Transmission Company
2
Sakarya University, Electric - Electronic Engineering Department
[email protected], [email protected]

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.

Table 2. Frequencies used in forming DTMF tones.


Frequency 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 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.

2. The Structure of Keypad and DTMF Signal


DTMF is a method of representing digits with tones for communications [7]. DTMF tones are used
by all touch tone phones to represent the digits on a touch tone keypad. DTMF signaling used for

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.

Fig. 4. Touch tone telephone keypad

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.

3. DTMF Signal Generation and Detection


In communications, Discrete Fourier Transform (DFT) is used for frequency detection. DFT converts
the signal from time domain to frequency domain.

3.1 Goertzel Algorithm

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

Fig. 2. Direct realization of the goertzel algorithm

Goertzel algorithm [10], can be seen from the equation 2.

Vk (n) coeff (k).Vk (n1)  Vk (n  2)  x(n) (2)


where Vk (-1) = 0, Vk (-2) = 0, x (n) represents input sample. Recursively compute for n = 0….N.
Compute once every N;

X (k) Vk2 (N).Vk2 (N 1)  2.coeff(k).Vk (N).Vk (N 1) (3)


The IIR filter coefficients for the row and column frequencies are calculated from;

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

3.2 Validity Checking of DTMF Signal

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

4. Experimental Work and Performance Test


In this section, first of all the DTMF tones should be generated to detect and test. After generating,
we start to detect these tones by using Goertzel Algorithm. We generate the DTMF tones by using
Cool Edit Pro program with different properties and characteristics. This program provides to save
the signals as a wav file format which is read wavered command in MATLAB program, so the transfer
is provided. The needed characteristics in Cool Edit Pro Version 2.0 are specified. The sampling rate
should be 8000 Hz because 8000 Hz is used in telephony applications.
The voice of human can be approximately 3200 Hz and according to the Nyquist criteria the sampling
rate should be twice frequency of the original signal, so 8000 Hz for sampling rate is enough to operate
by using human voice. If the sampling rate is bigger than 8000 Hz, it is meaningless and becomes
complicated and the execution time of program is getting longer. The channel is selected mono. Stereo
can be selected, but there is no need another channel for the application. The DTMF tones are
generated from Cool Edit Pro program like figure 3. If we write “7” in dial string part, you will obtain
this signal seen in figure 4. If we analyze the DTMF signal in frequency domain in Cool Edit Program,
we get the figure 5.

Fig. 3. The setting for dial string and time durations

Fig. 4. The DTMF signal “7”

112
International Conference on Computer Science and Communication Engineering, Nov 2015

Fig. 5. The frequency analysis of the DTMF signal “7”

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”.

Fig. 6. The DFT magnitude of the DTMF signal “7”

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

You might also like