Digital Signal Processing Reference
In-Depth Information
% DTMF.m Core MATLAB file to generate DTMF signals
clear all
t = 1:8000;
t = t/8000;
num_1 = zeros(8000,1);
num_2 = zeros(8000,1);
...
;also num_0, num_star
num_pound = zeros(8000,1);
for n = 1:8000
num_1(n) = sin(2*pi*697*t(n)) + sin(2*pi*1209*t(n));
num_2(n) = sin(2*pi*697*t(n)) + sin(2*pi*1336*t(n));
...
num_pound(n)=sin(2*pi*941*t(n))+sin(2*pi*1477*t(n));
end
for i = 1:100000000
soundsc(num_1);
pause(1.5);
soundsc(num_2);
pause(1.5);
...
soundsc(num_pound);
pause(1.5);
end
FIGURE 10.2. Core MATLAB program to generate DTMF tones ( dtmf.m ).
The length of the signal affects the reliability of detection. If the buffer size is
too small, the probability of turning on the wrong LEDs increases because of the
uncertainty in frequency associated with short signals. If the buffer is too long, it
complicates the detection near the transmission points. The Dialpad signals have
the shortest duration.
10.1.2 Using RTDX with Visual C
++
to Display Detected
DTMF Signals on the PC
Figure 10.3 a shows the core of the C source program DTMF_BIOS_RTDX.c for the
RTDX version to provide a PC-DSK interface for displaying the DTMF signals on
the PC monitor. These signals are detected by the C6x on the DSK and transferred
to the PC for display. Figure 10.3 a can be completed readily. The complete RTDX
with Visual C
support files are included on the CD. Examples 9.7 and 9.8 and
Sections 10.3 and 10.5 illustrate RTDX using Visual C
++
.
Build this project as DTMF _ BIOS _ RTDX . Examples 9.1-9.3 introduce the use
of the configuration ( .cdb ) file. The interrupt is set within this configuration file.
The complete executable ( .out ) file is also on the CD. Load/run the executable
( .out ) file within CCS. Select Tools
++
Enable RTDX
(check it). Use one of the three options (as in the non-RTDX version) to input the
DTMF signals.
Æ
Configuration Control
Æ
Search WWH ::




Custom Search