Digital Signal Processing Reference
In-Depth Information
if(weight1477> weight2) {weight2 = weight1477; choice2=3;}
if((weight1>thresh)&&(weight2>thresh)) //set threshhold
{ // depending on choices1 and 2 turn on corresponding LEDs
if((choice1 == 1)&&(choice2 == 1)) { //button "1" -> 0001
DSK6713_LED_off(0);DSK6713_LED_off(1);DSK6713_LED_off(2);DSK6713_LED_on(3);}
... //for button "2","3",..,"*","0"
if((choice1 == 4)&&(choice2 == 3)) //button "#" -> 1100
{ DSK6713_LED_on(0);DSK6713_LED_on(1);DSK6713_LED_off(2);DSK6713_LED_off(3);}
} //end of if > threshold
else { //weights below threshold, turn LEDs off
DSK6713_LED_off(0);DSK6713_LED_off(1);DSK6713_LED_off(2);DSK6713_LED_off(3);}
return;
}
void main()
{
DSK6713_LED_init();
DSK6713_LED_off(0);DSK6713_LED_off(1);DSK6713_LED_off(2);DSK6713_LED_off(3);
for (i = 0; i < N; i++) //define sine/cosine for all 7 frequencies
{
buffer[i]=0;
sin697[i]=1000*sin(2*3.14159*i/8000.*697);
cos697[i]=1000*cos(2*3.14159*i/8000.*697);
...
cos1477[i]=1000*cos(2*3.14159*i/8000.*1477);
}
comm_intr(); while(1); //init, infinite loop
}
FIGURE 10.1. ( Continued )
1. A phone to create the DTMF signals and a microphone to capture these
signals as input to the DSK's mic input. See Chapter 1 on how to modify the
header file c6713dskinit.h to select the mic (in lieu of line) input as active
by changing the value of register 4 from 0x0011 to 0x0015 in the header file.
(An appropriate microphone with the necessary pre-amp can be used and
connected directly to the line input on the DSK.) For the threshold value set
in the program, use 1000000 with the microphone input option. Dial a few
numbers and verify the corresponding LEDs turning on based on the number
detected.
2. Figure 10.2 shows the core of the MATLAB program DTMF.m that gener-
ates/plays DTMF signals as input to the DSK. This program can be completed
readily. Verify that all 12 DTMF signals 0, 1,...,# are consecutively gener-
ated by the MATLAB program, each lasting approximately 1.5 second. Also
verify that the corresponding LEDs on the DSK are turned on for each
detected DTMF signal. For the line input, use a threshold value of 40000 in
the program.
3. A tone generator using DialpadChameleon (can be downloaded from the
web). This provides a pad with keys to generate short DTMF signals that can
be used as input to the DSK.
Search WWH ::




Custom Search