Generation, Analysis and Detection of DTMF Signaling Based on DSP

Publisher:心有归属Latest update time:2011-03-31 Source: elecfansKeywords:DSP Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Dual Tone Multi-Frequency (DTMF) signaling is gradually being used on touch-tone telephones around the world. It quickly replaced the dial pulse signaling used in traditional rotary phones because it provides a higher dialing rate. In recent years, DTMF has also been used in interactive controls, such as voice menus, voice mail, telephone banking, and ATM terminals. Integrating the generation and detection of DTMF signaling into any system containing a digital signal processor (DSP) is a valuable engineering application.

The DTMF codec converts keystrokes or digital information into a dual-tone signal during encoding and sends it. During decoding, it detects the presence of keystrokes or digital information in the received DTMF signal. Each key on the telephone keypad is uniquely identified by the row frequency and column frequency shown in Figure 1. The DTMF encoding and decoding scheme does not require excessive computation and can be easily executed concurrently with other tasks in the DSP system.


Figure 1

As shown in Figure 1, a DTMF signal is composed of two superimposed audio signals. The frequencies of the two audio signals come from two pre-assigned frequency groups: row frequency group or column frequency group. Each pair of such audio signals uniquely represents a number or symbol. In order to generate a DTMF signal, the DSP uses software to generate two sine waves and superimposes them before sending them. When decoding, the DSP uses an improved Goertzel algorithm to search for the existence of the two sine waves in the frequency domain. This article discusses the implementation of DTMF encoding and decoding on TI's fixed-point DSP chip TMS320C54x (hereinafter referred to as C54x) series.

1. Generation of DTMF signals

The DTMF encoder is based on two second-order digital sine wave oscillators, one for generating the line frequency and the other for generating the column frequency. By loading the corresponding coefficients and initial conditions into the DSP, only two oscillators can be used to generate the required eight audio signals. The typical DTMF signal frequency range is 700 to 1700 Hz. Selecting 8000 Hz as the sampling frequency can meet the Nyquist condition.

Figure 2

From the block diagram of the digital oscillator pair in Figure 2, the differential equation of the second-order system function can be obtained as follows:

y(n) = -a1y(n-1) - a2y(n-2) (1)

Where a1=-2cosω0, a2=1, ω0=2πf0 /fs, fs is the sampling frequency, f0 is the frequency of the output sine wave, and A is the amplitude of the output sine wave. The initial value of this formula is y(-1)=0, y(-2)=-Asinω0.

The CCITT specification for DTMF signals is that the transmission/reception rate is 10 digits per second, that is, 100ms for each digit. The audio signal representing the digit must last at least 45ms but no longer than 55ms. The rest of the 100ms is silent in order to distinguish between two consecutive key signals.

Figure 3

The programming process is shown in Figure 3. According to CCITT regulations, there must be silence of appropriate length between digits. Therefore, the encoder has two tasks, one is the audio signal task, which generates dual-tone samples, and the other is the silence task, which generates silence samples. After each task is completed, before starting the next task (audio signal task or silence task), the timer variable that determines its duration must be reset. After the silence task is completed, the DSP calls the next digit from the digital buffer, determines the row frequency and column frequency signals corresponding to the digital signal, and determines its initialization parameters a1=-2cosω0 and y(-2)=-Asinω0 according to different frequencies.

The flowchart can be implemented in C language, and the generation of dual-tone signals is implemented by 54x assembly code. The entire program is used as the transmitting serial port interrupt service subroutine of the C54x multi-channel buffered serial port (McBsp). The interrupt is triggered by the external 8000Hz serial port clock, and can process in real time and output DTMF signaling signals through the D/A converter.

2 DTMF signal detection

Detecting DTMF signals in the input signal and converting them into actual numbers is a continuous process in nature, which requires continuous searching for the existence of DTMF signal spectrum in the input data signal stream. The entire detection process is divided into two steps: first, using the Goertzel algorithm to extract spectrum information from the input signal; then checking the validity of the detection result.

2.1 Goertzel algorithm

DTMF decoding is to search for valid line and column frequencies in the input signal. DFT and its fast algorithm FFT can be used to calculate the spectrum of digital signals, and the Goertzel algorithm is faster than FFT when implementing DTMF decoding. FFT can be used to calculate all spectral lines of the signal and understand the entire frequency domain information of the signal. For DTMF signals, only the 8 line/column frequencies and their second harmonic information need to be concerned (the second harmonic information is used to distinguish DTMF signals from sound signals). At this time, the Goertzel algorithm can extract spectrum information from the input signal more quickly.

Figure 4

The Goertzel algorithm is essentially a two-pole IIR filter, and its algorithm principle block diagram is shown in Figure 4. Since the input signal in DTMF detection is a real number sequence, it is not necessary to detect the phase of the eight row/column frequencies, but only to calculate the square of their amplitude.

2.2 DTMF Detector Process

The detection process can be referred to Figure 5. The detection program is used as the McBsp receive interrupt service subroutine of C54x. When each receive interrupt arrives, it indicates that a new sample point has been collected. The sample point value is substituted into formula (2), and the intermediate variable vk(n) of the 8 row/column frequencies is iteratively calculated (k is the digital frequency corresponding to the 8 row/column frequencies) until N=125 samples are collected (at a sampling frequency of 8kHz, it is about 15ms). At this time, the amplitude square of the 8 row/column frequencies |X(k)|2 is calculated according to formula (4). Next, |X(k)|2 is compared with the threshold, and a second harmonic detection is performed to determine a valid audio signal. After the audio signal is mapped to a digital signal, it is compared with the last detected digital signal to finally determine a valid digital signal.

Figure 5

The DTMF signaling detection program is obtained according to the flow shown in Figure 5. The entire program is used as the McBsp receiving serial port interrupt service subroutine of C54x, so that the DTMF signaling signal from the A/D converter can be analyzed in real time.

3 Performance Analysis

Based on the above principles and algorithm codes, the performance of the above DTMF signaling generation and detection scheme is analyzed in Code Composer Studio (CCS), a DSP development environment of TI.

(1) According to the following memory image file report given by CCS, the two core codes of DTMF generation (gen_dtmf.obj) and DTMF detection (de_dtmf.obj) occupy 3e6H and 1e0H words (16-bit word) respectively, that is, about 1K words of memory space, consuming very low system resources;

(2) The generation and detection procedures of DTMF signaling are placed in the McBSP interrupt service subroutine of C54x. The code execution time is analyzed by the CCS code analysis tool. When C54x runs at a main frequency of 100MHz, the DTMF generation interrupt service subroutine interrupt transmit() consumes a maximum of 283 clock cycles, that is, 2.83μs, and the DTMF detection interrupt service subroutine interrupt receive() consumes a maximum of 6148 clock cycles, about 61μs. Therefore, this solution can generate and detect DTMF signaling in real time, and can also ensure time redundancy and concurrent execution with other programs in the user system.

Keywords:DSP Reference address:Generation, Analysis and Detection of DTMF Signaling Based on DSP

Previous article:SoC-type DSP chip TMS320LF2407 is used in speed measurement and remote transmission
Next article:Design of Imaging Guidance Simulation System Based on DSP Chip TMS320C6418

Recommended ReadingLatest update time:2024-11-16 20:35

Design of serial communication between DSP and single chip microcomputer in high power UPS
1 Introduction With the rapid development of computer systems and communication equipment, the application scope of uninterruptible power supply (UPS) is becoming wider and wider. The demand for UPS in banks, securities, communication base stations, etc. is also increasing day by day. This paper mainly introdu
[Power Management]
Design of serial communication between DSP and single chip microcomputer in high power UPS
Design of electro-hydraulic servo controller based on DSP and STM32
introduction Most servo control systems use traditional hardware structures, and the control algorithms are relatively fixed. In addition, they cannot realize high-performance control algorithms under different working conditions, which makes it difficult to meet the needs of modern industry. At present, there is an
[Microcontroller]
Design of electro-hydraulic servo controller based on DSP and STM32
Digital filter design based on DSP C54x
Preface In an actual application system, there are always various interferences. When using DSP for digital signal processing, the signal can be extracted from the noise, that is, a mixed source of noise and signal is sampled, and then passed through a digital filter to filter out the noise and extract useful signals
[Analog Electronics]
Starting from the principle, analyze the implementation of the Chinese character speech recognition system based on DSP
Speech recognition is a high-tech technology that converts speech signals into corresponding text files or commands through the process of recognition and understanding. As a specialized research field, speech recognition is also an interdisciplinary subject, which is closely related to many disciplines such as acous
[Embedded]
Starting from the principle, analyze the implementation of the Chinese character speech recognition system based on DSP
High-speed data transmission between DSP and PC via PCI bus
TMS320C6713 is a new generation floating-point DSP chip of C6000 series launched by TI based on TMS320C6711. It is the highest performance DSP chip in C6000 series so far. TMS320C6713 can realize 1800MIPS/1350MFLOPS of fixed-point and floating-point operations at a clock frequency of 255MHz, thus greatly meeting the
[Embedded]
Design of medium frequency power supply test system based on DSP2407
This design uses the powerful digital signal processing capabilities of the digital signal processor (DSP) to test, analyze and calculate the AC voltage and frequency in order to evaluate the performance of the medium frequency power supply. 1 System Hardware Design 1.1 System Hardware Block Diagram Th
[Embedded]
Design of medium frequency power supply test system based on DSP2407
External interrupt of DSP chip TMS320f2812
I. Experimental Purpose 1. Be familiar with the interrupt response process of F2812A through the experiment. 2. Learn to design interrupt programs in C language and use interrupt programs to control program flow. II. Experimental Principle 1. Interrupts and interrupt processing process (1) Inter
[Industrial Control]
External interrupt of DSP chip TMS320f2812
DSP software design using C and assembly language mixed programming
As we all know, assembly language has higher performance advantages, while coding in C language can be implemented more easily and quickly. The continuous enhancement of DSP processor functions and the improvement of compiler optimization technology have gradually eliminated the traditional practice of writing DSP app
[Embedded]
DSP software design using C and assembly language mixed programming
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号