Digital Signal Processing Reference
In-Depth Information
FIGURE 5.20. CCS time- and frequency-domain plots of output with two tones.
Figure 5.19 shows a listing of the program two_tones.c that implements a tone
generation using a difference equation. The array y1[3] contains the values for
y 1(0), y 1(
2) to generate a 1.5-kHz tone, and the array y2[3] contains
the values for y 2(0), y 2(
-
1), and y 1(
-
2) to generate a 2-kHz tone. The function
sinegen uses the second-order difference equation to generate each tone, then
adds the two tones. Scaling by 2 14 allows for a fixed-point implementation.
Build and run this project as two_tones . Verify that the output is the sum of
the 1.5- and 2-kHz tones. The output is also stored in a memory buffer. Use CCS to
plot the FFT magnitude of the two sinusoids, as shown in Figure 5.20. The starting
address of the buffer is sinegen_buffer (see also Example 1.2). Figure 5.20 also
shows the time-domain plot of the two sinusoids.
The technique above can be used to generate dual-tone multifrequency: for
example, generating and adding the two tones with frequencies of 697 and 1209 Hz,
which correspond to the key “3” in a phone.
-
1), and y 2(
-
Search WWH ::




Custom Search