In many cases, the data output by the DTMF decoder still needs to be sent to the microcontroller for corresponding calculation and processing, and then control the actions of various other devices. Therefore, if a decoding algorithm for DTMF signals based on a microcontroller can be found, supplemented by a simple shaping circuit, it can not only save the complete set of decoding circuits, but also achieve the purpose of simplifying the circuit and reducing costs.
This article introduces the original intention of this concept, and the results of computer simulation calculation data prove that it can fully meet the design requirements.
1. Frequency composition of DTMF signal and amplitude density of DTMF signal before shaping
In the DTMF signal, each of the 16 command keys is composed of two single-tone frequency signals (see Table 1). There are two groups of single-tone frequencies, the high-frequency group is (1209Hz, 1336Hz, 1447Hz, 1633Hz), and the low-frequency group is (697Hz, 770Hz, 852Hz, 941Hz). Each command key corresponds to a combination of a high-frequency group frequency and a low-frequency group frequency. Take the "*" command key as an example: its DTMF signal is composed of a low-frequency group signal of 941Hz and a high-frequency group signal of 1209Hz. Figure 1 is its spectrum diagram.
Table 1 DTMF signal frequency composition table
As can be seen from Figure 1, the DTMF signal of the "*" command key has spectral lines at 941Hz and 1209Hz. Under ideal conditions, the modulus values of the spectrum density function X(f) at f=941Hz and 1209Hz can be calculated as |X(941)|, |X(1209)|, that is, their modulus values are not zero. In other words, if the modulus values of the spectrum density function exist at the same time as |X(941)|, |X(1209)|, and their modulus values are not zero, the key number represented is "*". By analogy (see Table 1), the modulus values of the low-frequency group signals |X(697)|, |X(770)|, |X(852)|, |X(941)| and the high-frequency group signals |X(1209)|, |X(1336)|, |X(1447)|, |X(1633)| can be calculated respectively. If there is a X(f) whose modulus value is not zero in each of the high-frequency group and the low-frequency group, then the command key represented by it is found in Table 1 through f.
When using a single-chip microcomputer to perform X(f) calculations, namely, discrete Fourier transform (DFT), only DTMF signals of finite length can be analyzed and processed, that is, discrete Fourier transform can be performed on N data within a finite time Tp=NT (N is the number of sampling points, T is the sampling time interval).
According to the DFT definition:
Taking the “*” command key signal as an example, in the high frequency group f=1209 Hz, the number of sampling points N=256, and the sampling time interval T=55×10-6 S, K=f×N×T, we can get K=17, that is, |X(17)| is the amplitude density of the DTMF signal at a frequency of 1209 Hz, and its value is 121.5. In the low frequency group f=941 Hz, the number of sampling points N=256, and the sampling time interval T=54×10-6 S, K=f×N×T, we can get K=13, that is, |X(13)| is the amplitude density of the DTMF signal at a frequency of 941 Hz, and its value is 123.6. Similarly, the amplitude density of the other 15 command keys can be calculated, see Table 2 (Table 2 is the amplitude density of the DTMF signals of the 16 command keys after computer simulation calculation).
Table 2 Amplitude density of DTMF signal before shaping
From Table 2, we can see that due to the leakage effect caused by the truncation of the infinite-length DTMF signal in the time domain, for example, although the DTMF signals corresponding to the "2" and "3" keys do not contain the signal components with frequencies of 1209 Hz and 941 Hz, |X(17)| and |X(13)| are not zero. Ideally, they should be zero, which means that there is a certain amplitude density error. However, for the DTMF signals containing the high-frequency group signal of f=1209 Hz (such as the "1", "4", "7", and "*" keys), their |X(17)| values are much larger than the |X(17)| values of the DTMF signals without the high-frequency group signal of f=1209 Hz. Similarly, for the DTMF signals containing the low-frequency group signal of f=941 Hz, the |X(13)| values of the DTMF signals are much larger than the |X(13)| values of the DTMF signals without the low-frequency group signal of f=941 Hz. This provides the necessary conditions for the actual DTMF signal decoding and recognition. In actual DTMF signal decoding applications, the decoding process of the DTMF signal corresponding to any key number is:
(1) Sample the DTMF signal and calculate the amplitude density |X(k)| of the spectrum lines at 697 Hz, 770 Hz, 852 Hz, and 941 Hz respectively.
(2) Sort them and find the value of the low-frequency group frequency fL corresponding to the maximum amplitude density |X(k)|.
(3) Calculated in the same way, the amplitude density |X(k)| of the spectral lines at 1209 Hz, 1336 Hz, 1467 Hz, and 1633 Hz.
(4) Sort them and find the value of the highest frequency group frequency fH corresponding to the largest amplitude density |X(k)|.
(5) By looking up Table 1 based on fL and fH, the key number they represent can be obtained.
2. Amplitude density of DTMF signal after shaping and error analysis of experimental data
In order to send the DTMF signal to the single-chip microcomputer for DTMF signal decoding, the DTMF signal must be shaped, as shown in Figure 2. After the DTMF signal is compared and limited, it is shaped into a square wave. From the definition of DFT transformation, it can be seen that the value of x (nT) can only be 0 or 1, so the amount of calculation of |X (k) | is greatly reduced. Table 3 is the amplitude density calculated by computer simulation through the DTMF signal after shaping.
Figure 2 DTMF signal comparison and limiting diagram
Table 3 Amplitude density table of DTMF signal after shaping
Comparing Table 3 with Table 2, it can be found that the amplitude density of the leakage spectrum of the DTFM signal after shaping into a square wave increases, while the amplitude density of the effective spectrum decreases accordingly. For example, the amplitude density of the leakage spectrum generated by the No. 7 command key increases from 14.09 to 22.38, while the effective amplitude density decreases from 127.9 to 107.26. The main reasons for this problem are:
(1) Since N and T can only be integers, 1/f cannot be divided by N×T, so this will inevitably lead to a fence effect. At this time, the amplitude density of the effective spectrum calculated will inevitably be smaller than the actual value. At the same time, the leakage effect caused by the finite length of the sampling time Tp=NT will inevitably lead to an increase in the amplitude density of the leakage spectrum.
(2) After the DTMF signal is shaped into a square wave, it will produce a lot of harmonic interference. If the frequency of these interference signals is close to the frequency of the leakage spectrum, the amplitude density of the leakage spectrum will also increase.
Therefore, in the decoding process, if the amplitude density of the effective spectrum line decreases, while the amplitude density of the leakage spectrum line increases, when the amplitude density of the leakage spectrum line is greater than the amplitude density of the effective spectrum line, it will cause misinterpretation and missed interpretation. Therefore, if the N×T value is too small, or the difference with the integer multiple of the period to be measured is too large, coupled with harmonic interference after shaping into a square wave, it may cause misinterpretation and missed interpretation.
However, it can be seen from Table 3 that the maximum amplitude density of the leakage spectrum is 22.38, while the minimum amplitude density of the effective spectrum is 87.92. The difference between the two is nearly 4 times, and there is still a large amount of redundancy. For example, for DTMF signals containing f=1209 Hz high-frequency group signals (such as "1", "4", "7", "*" keys), their |X(17)| values are still much larger than the |X(17)| values of DTMF signals without f=1209 Hz high-frequency group signals. Similarly, for DTMF signals containing f=941 Hz low-frequency group signals, the |X(13)| values are also much larger than the |X(13)| values of DTMF signals without f=941 Hz low-frequency group signals. The two can still be clearly distinguished in the sorting. Therefore, the increase in the certain amplitude density error generated after the DTMF signal is shaped can be completely ignored. As long as the decoding application is properly designed and the N and T values are reasonably selected, there will be no mistranslation or omission.
When the DTMF signal is relatively accurate or the interference is small, the operation speed can even be increased and the decoding time can be reduced by reducing the values of N and T.
Previous article:Several suggestions on EMC design of single chip microcomputer
Next article:Design of digital potentiometer based on single chip microcomputer
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications