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 row 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 row/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.
Previous article:Design and implementation of embedded clock manager
Next article:Realization of the electronic control unit of the mechatronic brake system based on CAN bus
Recommended ReadingLatest update time:2024-11-23 02:51
- Popular Resources
- Popular amplifiers
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- Vicor high-performance power modules enable the development of low-altitude avionics and EVTOL
- Bourns Launches Two Thick Film Resistor Series with High Power Dissipation Capabilities in Compact TO-220 and DPAK Package Designs
- Bourns Launches New High-Pulse Brake Resistor Series with Superior Energy Dissipation Capabilities
- Nexperia launches new 120 V/4 A half-bridge gate driver to further improve robustness and efficiency in industrial and automotive applications
- Vishay's New 150 V MOSFETs Offer Industry-Leading Power Loss Performance
- The first generation of SGT MOSFET series from Qiangmao: innovative trench technology, automotive-grade 60 VN channel, breakthrough in high-efficiency performance of automotive electronics
- DC/DC Power Supplies for Automotive Applications
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- How to deal with the acidic wastewater from acid salt spray testing of metal electronic products and devices?
- Summary: annysky2012's practical journey of motor development based on "STM32F746ZG+IHM07M1"
- Smart home management based on ESP8266 WIFI network control and Gizwits Cloud
- Understand the past and present of NFC in one article!
- When power saving is required, how should the LCD screen's SEG pin, COM pin, VLVD1-3, and VLCDH related configurations be configured?
- [New version of Bluesun AB32VG1 RISC-V development board] - 1: From "New" to "0 errors, 0 warnings."
- 1- Design of vending machine based on 51 single chip microcomputer (schematic diagram + PCB + paper + program)
- Low power consumption design of PIC microcontroller in telephone remote controller
- Advanced C/C++ Compilation Technology
- How to use multiple serial ports on CC2642R? Can 3 serial ports be used?