Design of embedded DTMF dial decoder using MSP430

Publisher:闪耀之星Latest update time:2012-06-04 Source: 21ic Keywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction
DTMF (Dual Tone Multi-Frequency) signals are commonly used in telephone networks. Whether it is a home phone, mobile phone or program-controlled exchange, DTMF signals are often used to send and receive numbers. DTMF technology can also be used in power line carrier communications and other occasions. It can be seen that DTMF dialing and decoding are widely used in communication systems and other aspects. Usually, the detection of DTMF signals is implemented using dedicated chips or DSPs, but the cost is relatively high. This article introduces a low-cost DTMF dial decoder implementation based on MSP430F133. MSP430F133 is a 16-bit RISC structure MCU from TI with a minimum instruction cycle of 150ns, 8KB Flash ROM, 256B RAM and a built-in 12-bit ADC.

DTMF signal
DTMF signal is a coding method that uses 8 frequencies in the audio range to represent the 16 characters on the dial, 0~9, A~D, */E, #/F. The 8 frequencies are divided into two groups, high frequency group and low frequency group, which are used as column frequency and row frequency respectively. The signal of each character is composed of the superposition of two frequency sinusoidal signals from the column frequency and the row frequency. The frequency combination method is shown in Figure 1.

According to CCITT Q.23, the technical indicators of DTMF signals are: the transmission/reception rate is 10 numbers per second, or 100ms for each number. During the transmission of each number, the signal exists for at least 45ms and no more than 55ms, and the rest of the 100ms is silent. A frequency error of no more than ±1.5% is allowed at each frequency point. Any signal that exceeds ±3.5% of the given frequency is considered invalid and refused to be received. In addition, under the worst detection conditions, the signal-to-noise ratio shall not be less than 15dB.

DTMF dialing
The circuit schematic of the DTMF dialing part is shown in Figure 2. The circuit mainly consists of a resistor network and a filter composed of 4 I/O lines. The resistor network constitutes a 4-bit DAC, and the high-pass filter and low-pass filter form a bandpass filter to filter out the harmonic signals of the dual audio. A 600Ω 1:1 transformer is used at the output end to interface with the telephone line. The output level of the telephone line can be adjusted by changing Rx.

[page]

The software uses a table lookup method to simulate the generation of two sine waves of different frequencies. First, determine a suitable sampling interval, sample the sine waves of each frequency and normalize them to 0~7 (3-bit data), and make a corresponding sine table. The sine table should ensure that the frequency error of the synthetic signal is within ±1.5%, and the number of sampling points should be as small as possible. In order to reduce the waveform distortion, the total signal time recorded by the sine table corresponds to an integer number of cycles of the original signal, and the sampling starting point is selected at the peak of the positive waveform. The sampling interval of this design is selected as 122us to ensure that the frequency error is within ±1%. The number of sampling points and frequency error of each frequency signal are shown in Figure 3.

The DTMF dialing program flow chart is shown in Figure 4.

DTMF decoding
To decode DTMF using software, the analog signal must first be converted into a digital signal and then sent to the CPU for processing. The analog-to-digital conversion can be achieved by using the built-in 12-bit ADC of MSP430F133 plus a simple interface. The ADC interface circuit is shown in Figure 5. A metal film resistor with a precision of 1% should be selected. The ADC reference voltage is selected as the internal 2.5V:

DTMF decoding can determine whether it is a valid DTMF signal and which number is received by calculating the spectrum value of the received signal at 8 predetermined frequency points. In addition, a series of validity checks are required to prevent misjudgment.

FFT can be used to calculate the spectrum value at N frequency points, but it is not suitable for this application. Because it calculates many unnecessary values, the amount of calculation is too large; and in order to ensure frequency resolution, the number of FFT points is large. In addition, it cannot be processed in a sample-by-sample manner, which is not conducive to real-time implementation.

Since only the spectrum values ​​of 8 specific points need to be known, a DFT algorithm called the Goertzel algorithm can effectively improve the computational efficiency. It is equivalent to an IIR filter with two poles. The 8 frequency points correspond to their own matching filters, and their transfer function is

However, the Goertzel algorithm still has a disadvantage, that is, it calculates the spectrum value at the frequency , while the exact frequency value usually only corresponds to an approximate integer k. In order to achieve the required resolution, a larger number of samples N is required. The improved method is: modify the transfer function, do not calculate the spectrum value at the angular frequency , but calculate the spectrum value at the exact angular frequency . In this way, the resolution can reach the resolution of the natural windowing (rectangular window) of the data. Its transfer function is

The improved Goertzel algorithm operation steps are as follows:
1. Recursively calculate for each sampling point (n=0,1,…,N)

The initial condition is

2. After N sample points are collected and calculated, 8 spectrum values ​​are calculated:

Based on the selected sampling frequency of 6Khz, the required frequency resolution can be achieved by selecting N=86 samples, which corresponds to a signal of about 15ms, ensuring that one number can receive two complete DTMF signal cycles.

After the eight spectrum values ​​are calculated, a DTMF validity check is performed to determine whether it is a valid DTMF signal. The validity check includes the following items: (1) The maximum amplitude of the high and low frequency bands must be greater than a certain threshold value, and the sum of the two must also be greater than a certain threshold value. (2) The difference between the maximum amplitude of the high and low frequency bands and the other three amplitudes of each frequency band must be greater than a certain threshold value. (3) The reverse twist test means that the maximum amplitude of the low frequency band shall not exceed the maximum amplitude of the high frequency band by 8dB, and the standard twist test means that the maximum amplitude of the high frequency band shall not exceed the maximum amplitude of the low frequency band by 4dB. (4) The ratio of the sum of the maximum amplitudes of the high and low frequency bands to the sum of the other six amplitudes must be greater than a certain threshold value.

If the above test is passed, the current cycle DTMF signal is determined to be valid, and the corresponding number can be determined based on the frequency combination. However, to confirm that a valid number has been received, two conditions must be met. First, there must be more than two consecutive cycles of valid and identical DTMF signals to ensure the signal duration, and second, there must be enough silence time in front to avoid repeated recognition.

The DTMF decoding program flow chart is shown in Figure 6.

Each iteration of decoding requires eight multiplications. Since F133 does not have a hardware multiplier, it must use "shift and add" for multiplication. Therefore, optimizing the multiplication operation will greatly improve the calculation efficiency. The optimization is considered from several aspects: try to use the register addressing method to make full use of the 150ns instruction; in addition, the multiplier of each frequency point is fixed and known, so "shift and add" can be used instead of looping and judging bit by bit, and can be fully expanded bit by bit to save the judgment action; in addition, adding a simple gain control at the front end can ensure that the subsequent operation does not overflow, saving overflow processing. After the above optimization, real-time decoding of DTMF is realized.

Conclusion The DTMF dial decoder solution has low cost and reliable performance and has been put into practical application.

Keywords:MSP430 Reference address:Design of embedded DTMF dial decoder using MSP430

Previous article:Design of wireless handheld terminal based on SX1233
Next article:Analysis of Dynamic Clock Configuration of MSP430 Series MCU

Recommended ReadingLatest update time:2024-11-17 00:18

Design of Switching Power Supply Control Using MSP430 Single Chip Microcomputer in Power System
The MSP430 series single-chip microcomputer is a 16-bit ultra-low power mixed signal processor launched by Texas Instruments (TI) in 1996. It is highly praised by users for its ultra-low power consumption, powerful processing capability, high-performance analog technology, rich on-chip peripheral mod
[Power Management]
Software and hardware implementation technology of DTMF remote communication
     Abstract: This article details the key software and hardware technologies for remote communication using DTMF technology. Its circuit has the characteristics of simple implementation, low cost and high reliability. Cooperating with related software, it can also realize two-way call communication, correctly identi
[Industrial Control]
MSP430 MCU Program Upgrade Example
Introduction to MSP430 MCUTI's MSP430 series MCU is an ultra-low power mixed signal controller. It uses a 16-bit reduced instruction set and integrates 16 general registers and constant generators, which greatly improves the execution efficiency of the code; the concise 27 core instructions are easy to learn; and the
[Microcontroller]
MSP430 C language keyword expansion
1.interrupt is used for interrupt function. The definition is as follows: Syntax: interrupt void function name() or interrupt void function name() Parameters: The interrupt function has no parameters. The interrupt function needs to specify the interrupt vector. Return: The interrupt function is generally
[Microcontroller]
In-depth understanding of MSP430 microcontroller IO
1. Overview of MSP430 MCU ports P1~P6 each group has 8 I/O ports, P3, P4, P5, P6 have I/O and other on-chip peripheral functions, each group has 4 registers. In addition to the above functions, P1 and P2 also have interrupt capabilities, each group has 7 registers. 2. PX Port 1. P1, P2 ports (1) PxDIR Input/ou
[Microcontroller]
Design of 12-lead synchronous electrocardiograph based on MSP430 single chip microcomputer
MSP430 series microcontrollers are widely used in the medical equipment industry. They are favored by designers for their low power consumption and simple peripheral design. However, complex medical equipment such as electrocardiograms or CT are widely used. Electrocardiographs are one of the important instruments for
[Microcontroller]
Design of 12-lead synchronous electrocardiograph based on MSP430 single chip microcomputer
Capacitive touch MSP430 circuit and LED drive circuit design explanation
  The MSP430 series of microcontrollers are famous for their low power consumption and rich peripheral modules. For capacitive touch applications, the PIN RO capacitive touch detection method of MSP430 supports direct connection of the IO port to the detection electrode without any peripheral devices, which greatly si
[Power Management]
Capacitive touch MSP430 circuit and LED drive circuit design explanation
An AC frequency detection system based on MSP430 single chip microcomputer
1 Introduction Since frequency signals have the advantages of strong anti-interference, easy transmission, and high measurement accuracy, many non-frequency sensor signals are converted into frequency quantities for measurement and processing. Therefore, frequency measurement methods are attractin
[Microcontroller]
An AC frequency detection system based on MSP430 single chip microcomputer
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号