Abstract: Summarizes basic principle which the DTMF signal produces, proposed that uses SPCE061 the chip the D/A port and uses the I/O port to simulate D/A to produce the DTMF signal two kinds to realize the plan, and realizes the plan through the experiment and the simulation to two kinds to carry on the contrastive analysis. The experiment proved that because the D/A precision is high, uses D/The output the DTMF signal quality to use I/O the resistance network the DTMF quality to be better than; But in the sampling frequency enough high situation, used the I/O resistance network still to be possible to satisfy the telecommunication standard request.
Key word: Double sound multi-frequencies (DTMF) sin functional calculus SPCE061A MATLAB simulation
In the world scope, double sound multi-frequency DTMF (Dual Tone Multi Frequency) the signaling uses gradually on the pressed key type telephone, because it provides the higher digit dialing speed, has substituted for the dial pulsing signal which rapidly the traditional turntable type telephone uses. In recent years, DTMF also applied in the interactive control, like the language menu, the language mail, came the electricity demonstration, the Telephone banking and the ATM terminal and so on. When the chip interior does not have the built-in DTMF producer, even uses 4~5 ordinary I/O mouths and the simple resistance network with ordinary D/A simulates D/A to realize the DTMF signal production, will expand DTMF in the project application, has certain application value. This article mainly studies the above two kinds to use the software product DTMF signal the plan.
The DTMF signal becomes by 8 frequency 22 combinations. These 8 frequencies divide into the low frequency group and the high frequency group two groups. The low frequency group’s 4 frequencies are in turn 697Hz, 770Hz, 852Hz, 941Hz; The high frequency group’s 4 frequencies are in turn 1209Hz, 1336Hz, 1477Hz, 1336Hz. In the correspondence domain application, DTMF mainly uses in the telephone digit dialing signal and CID (Caller Identification, comes electricity demonstration) the signal transmission. In applies in telephone’s digit dialing signal, according to the national telecommunication standard, its signal duration and the time interval is not smaller than 40ms, but the frequency departure is not bigger than ±1.5%.
1 traditional programmable hardware DTMF generator principle
The traditional DTMF generator chip has Hotel Corporation’s HT9200A/B, Mitel Corporation’s MT8880 and so on. Part MCU the built-in DTMF generator, its DTMF signal has also had the principle to be possible to summarize as follows:
The higher mode of oscillation signal which produces the oscillator delivers separately to two counters, when the counter achieves the preinstall the value, has a reverse signal output, forms the low frequency square-wave. And counter register available software establishment and has the autoloading function. May establish the output through these two counters two group square-wave frequency. When software compilation control procedure, only need correspond the frequency the counting value to read in controls the frequency code which the register then may produce automatically needs.
From the above two group output’s square-wave again clear signal sine processing and the amplitude control, then simultaneously deliver two groups signals to the signal mixer output. Thus, if in a group output square-wave frequency close DTMF low frequency group frequency, but in another group close DTMF high frequency group’s frequency, outputs from the mixer the signal was the DTMF signal which needed.
2 use D/A to produce the DTMF signal
The DTMF software producer is based on two with the software simulation second-order digit in the string wave oscillator, uses in producing low frequency, uses in producing high frequency. The typical DTMF signaling frequency scope is 697Hz~1633Hz. Selects 8192Hz to take the sampling frequency, then satisfies the Nyquist condition. In the system the signal synthesis’s functional equation is
Y(n) =a0 a1sin (2 · Pi · f0 · n/fs) a2sin (2 · Pi · f1 · n/fs) (1)
In the formula: a0 is the direct component; f0, f1 respectively are in DTMF low frequency and high frequency; fs is the sampling frequency, decides as 8192Hz in this; a1, a2 respectively are f0, the f1 oscillation amplitude; n is the sampling points.
2.1 sin function computation
The sampling frequency is not in the DTMF 8 frequencies various frequencies integral multiple, if uses the table look-up law to obtain various sampling points processing D/A value of exports, because the table look-up means the value of exports periodic appearance, then the request sampling frequency is outputs frequency many cycle integral multiples. Also because outputs in the data sheet to need to include many cycles, moreover must approach the above integral multiple, therefore the output frequency must be the sampling frequency integral multiple multiple. From this has the following several questions:
①Many cycle’s data sheets are big (about an average frequency 20 character);
②In the data sheet various values’ computation is numerous;
③Produces signaling frequency existence frequency offset.
If uses calculates the sin function the method, the above question will be easily solved. Is only, how to calculate the sin function? In the traditional electronic accounting machine system, the processing floating number wants complex compared to the processing integer, and takes the CPU much time; But in Zheng Yili in the piece machine system, has the request generally to program run’s time. Therefore, this article has used the fixed-point decimal approximate expression floating number method, calculates each spot place sine function value again using the linear interpolation.
Fixed-point decimal expression method: Will need to express the decimal space rides the space which a coefficient mapping integer can show. This article uses 16 monolithic integrated circuit SPCE061, its D/A precision is 10, the DAC output register or is 16 bit data high 10; the sin function’s value territory for [- 1, 1], rounded number territory [0x0000,0x03ff] maps in sin function value [0, 1], takes makes up the number to map in the sin function value the negative value, then satisfies the DTMF output accuracy requirement. The request 1 mapping is 0×03ff, therefore, when the function value is positive, should be multiplied by 0×03ff namely 1023, after taking the entire achievement to calculate the sin function sub-program the output; When function value for negative, only need the timing function value which corresponds take makes up then may obtain.
When calculates the sin function, 0~2 Pi mappings for entire number field [0x0000,0x4000], therefore, may 13th and 12 obtains the quadrant information through the entire number field. When table look-up only calculates the first quadrant [0, π/2] the sine value, the other quadrant’s function kind politics obtains by the trigonometric function formula computation. First quadrant sin function computation: 0~ π/2 are mapped entire number field [0x0000,0x1000], divides into 16 divisions it, break point in function value establishment data sheet, soon 0, 0×0100, 0×0200 and so on 17 spot place correspondence sine value list, if the radian value x is situated between two break point x1 and x2, obtains through the table look-up sin(x1) and sin(x2), then has:
sin(x)=sin(x1) [sin(x2)-sin(x1)](x2-x1)/256
Other quadrants may obtain the similar formula according to the trigonometric function formula.
2.2 DTMF signal software synthesis
Because in DTMF transmission process, high frequency in line’s transmission loss compared to low frequency high, to guarantee the signal arrives at when the switchboard high, low-frequency signal level basic quite, in the DTMF signal producer, the standing operating procedure group frequency intermediate frequency component level should compared to the low frequency component level high 2±1dB. In the DTMF hardware producer, this processing is between high, in the low-frequency signal mixer’s low frequency channel adds the suitable damping circuit to complete; But in uses D/A to have in the DTMF signal process, high, low-frequency signal’s mix is also completes by the software. Therefore, must in high, in the low-frequency signal generating process consider that causes the low-frequency signal the oscillation amplitude slightly to be lower than the high frequency signal, like this can obtain the electricity adjustment which from the output signal needs. The sin functional calculus which describes by 2.1 in results in the function value, is actual function value 1023 times. The type (1), takes y(n) the voltage range is 0~5V, direct component a0 is 2V; Makes the high frequency signal the level is Sh, low-frequency signal’s level is S1, the unit is dBm, then has
Sh=-20lg(Vh/V0) S1=-20lg(V1/V0) 1<Sh-S1<2
Takes Vh/V1=6/5, then Sh-S1≈1.6dB, namely takes a1 is 5, a2 is 6, then obtains high, the low frequency electricity adjustment is the 1.6dB signal. The y(n) mapping is SPCE061 D/A value of exports [0x0000,0xffc0], then the DAC output for (0xffc0/5) · y(n), the formula is as follows:
Supposes A=1023sin (2 · Pi · f0 · n/fs)
B=1023sin (2 · f1 · n/fs) (n=0,1,2…)
DAC (n) = (0xffc0/5) · y(n)=
12.8 (1023 · a0 a1A a2B) =
26189 5A 6B (2)
The type (2) A and B based on calculate sin the subroutine to obtain. Because 2π in quantification for integer time is 0×4000, namely 16384, but fs=8192Hz, the actual sin function sub-program independent variable then simplifies as (2nf0 and 0×3fff), this regarding monolithic integrated circuit’s processing is quite easy. DAC value which obtains by the above formula, the computed result data will have transferred to high 10, but direct output D/A register.
3 use the I/O mouth to simulate D/A to produce the DTMF signal
In certain applications, MCU which uses is quite simple, like 8051; Or because to cost control request, but cannot use brings D/A MCU, but needs to use these MCU to produce the DTMF signal, its alternative scheme is simulates D/A with many I/O mouths and the resistance network. Certainly, such electric circuit produces DTMF, its output precision compared to low which will produce by D/A, the noise also will be quite big, but already might satisfy the DTMF output in certain applications the request.
Figure 1 is simulates the D/A output with 4 I/O mouths the schematic diagram.
Figure 1 the 4 I/O mouth may express 16 conditions. Calculates under these 16 conditions after the tabulation on equal to pull the resistance and under pulls the resistance, may obtain under various conditions the differential pressure value. Take VCC as 5V is the example, then simulates the D/A output the precision is 0.3086V, is only equal to precision very low D/A. Tests after the experiment, when with 4 I/O mouths, the 8192Hz sampling frequency outputs the DTMF signal, must use 5 I/O mouth output to be able to meet the ordinary telephone telephone dialer’s requirements; If uses 4 I/O mouth output, then the request sampling frequency is bigger than 12kHz. This article introduced in the plan, used 4 I/O mouths, 16384Hz to take the sampling frequency, between the use output signal and the place electric capacity charging and discharging comes smoothly with the I/O mouth output staircase waveform, like this might reduce the distortion, caused the output the DTMF signal closer standard sine wave superimposition.
4 use the MATLAB simulation the experimental result
MATLAB is one kind of function quite formidable digital operation, the simulation software, makes the digital signal processing with it is also the quite simple event. The following experiment is produces the DTMF signal using the SPCE061A chip through its D/A and 4 I/O mouth, outputs sound card’s LINE its coupling in input port, the sampling obtains the DTMF signal the data, transforms again the signal data to the MATLAB software in carries on is separated the FFT analysis, obtains has the frequency domain the information. Figure 2 is the DTMF signal which outputs with D/A “1″ profile; Figure 3 is the DTMF signal frequency spectrum which outputs with D/A; Figure 4 is the DTMF signal which produces with 4 I/O mouth simulation “1″ profile; Figure 5 is with 4 I/O the mouth analog output DTMF signal frequency spectrum. Figure 3 and Figure 5 is with the MATLAB software simulation result. May see from Figure 2~5: Produces DTMF signal, in its frequency completely centralized stipulation two frequencies. Under two kind of plans produces the frequency which through the MATLAB analysis computation the DTMF profile, obtains the energy maximum value which appears is 1206Hz and great value frequency 689Hz, the frequency offset respectively is 0.25% and 1.14%, in DTMF signal stipulation scope. The frequency deviation is because the signal and discrete Fourier transform’s quantized error causes.
Figure 2 and Figure 4 waveform’s abscissa is the time, approximately 12ms; The y-coordinate is the sound card sampling quantification voltage value, the sound card sampling precision is 16, the sampling frequency is 44.1kHz; Figure 3 and Figure 5 the abscissa is a frequency; The y-coordinate to be separated the FFT analysis result (with complex representation frequency domain information) mold. In Figure 3, besides the DTMF two frequencies, other frequencies has not presented the big burr, the profile is attractive, the signal degree of distortion is low.
In Figure 5, besides the DTMF two frequencies, other frequencies had many place presented the burr, the signal degree of distortion big which demonstrated compared to Figure 3.
5 summaries
This article elaborated has had the DTMF general method and the performance with D/A, and proposed simulated D/A with ordinary I/O to have the DTMF method. In does not have in the DTMF hardware producer’s monolithic integrated circuit application, may act according to the actual situation to select the DMTF plan which the above two kind of softwares produce. The suggestion choice has D/A MCU. Produces DTMF with D/A compared to use the I/O mouth simulation to produce the double sound multi-frequency signal to have the following several merits: The D/A precision is high (ordinary D/A to have 8 or above 8), produces the signal degree of distortion is small; The sampling frequency request is low, can satisfy the Nyquist condition then, the software produces when the signal fixed time outputs with the interrupt, the interrupt frequency is also quite low, thus takes the CPU time to be few; Outputs the DTMF signal with D/A, does not need the resistance network, the peripheral circuit is simple. Outputs the DTMF signal with D/The shortcoming is: Requests MCU to have the D/A output, has the limitation in the application; In certain low end’s application, brings D/A MCU other resources to be also many, the cost is relatively quite high. Simulates D/A with many I/O mouths not to have the above limitation, needs 4 above I/O mouths, (the MCU basic frequency which about the 1.5MIPS instruction execute speed in the above experiment uses is only 6.144MHz, majority of instruction time is 3~8 machine cycles). These two requests are majority of low-grade, low-grade cost MCU (including part 51 series chips) have, therefore the plan realizes from the system is more advantageous to the control cost; But precision insufficiency, degree of distortion big and so on questions, may through increase the I/O mouth the integer to solve. If does not have the unnecessary I/O mouth, according to the practical application situation, may consider the certain I/O mouth time sharing multiplying.
Certainly, has the DTMF method also to have many. Produces with the software may use PWM the way (to request MCU to have high carries out speed), produces with the hardware may use the signal generating device and so on; But was opposite in using D/A or the ordinary I/O mouth, its complex degree and the cost divided are quite high. Therefore, produces the DMTF signal with D/A or ordinary I/O to have a more widespread application.