Digital Signal Processing Reference
In-Depth Information
resulting FFT data to the PC running MATLAB for finding the spectrogram. A total
of N /2 (128 points) are sent (in lieu of 256) for better resolution (continuity). The
( .cdb ) configuration file is used to set interrupt INT11, as in Section 9.1. From
this configuration file, select Input/Output
RTDX. Right-click on properties
and change the RTDX buffer size to 8200. Within CCS, select Tools
Æ
Æ
RTDX
Æ
Configure to set the host buffer size to 2048 (from 1024).
An input signal is read in blocks of 256 samples. Each block of data is then
multiplied with a Hamming window of length 256 points. The FFT of the windowed
data is calculated and squared. Half of the resulting FFT of each block of 256 points
is then transferred to the PC running MATLAB to find the spectrogram. Build
this project as spectrogram_rtdx_mtl . Within CCS, select Tools
Æ
RTDX
Æ
Configure.
Open MATLAB, select the appropriate path, and run spectrogram_rtdx.m
(on the CD). Within MATLAB, CCS will enable RTDX, and will load and run the
COFF ( .out ) executable file. Then MATLAB will plot the resulting spectrogram
of an input signal. Input/play Chirp.wav (output of a sound card as input to the
DSK) and verify the spectrogram of this input signal plotted by MATLAB, as shown
in Figure 10.15 b . For a chirp input signal, the transfer of 128 points (in lieu of 256)
yields a better spectrogram.
For a faster and accurate plot, delete the commands within the MATLAB file
that include the labels ( x and y axes, and title) in the spectrogram plot.
Use a 500-Hz square wave as input and verify the spectrogram plot shown in
Figure 10.15 c . A darker red strip is formed at the 500-Hz fundamental frequency,
and lighter red strips at the other harmonics of 1500, 2500, and 3500 Hz. For this
type of input, you may choose to transfer the entire block of 256-point FFT data at
each time.
You can extend this project version using TI's optimized FFT function (see
Chapter 6).
10.8.3
Spectrogram with RTDX Using Visual C
++
for data transfer from the
DSK to the PC host. The program spectrogram_rtdx_r4.c (on the CD) imple-
ments a 256-point radix-4 FFT using TI's optimized FFT function and the associ-
ated support files for digit reversal. See also the two radix-4 FFT examples in
Chapter 7 and Section 10.5. As with the MATLAB version for RTDX, only 128
points are transferred at a time.
Change the buffer size to 8200 within the ( .cdb ) file, as with the previous
MATLAB version. Within CCS, change the host buffer size from 1024 to 2048.
Enable RTDX (there is no MATLAB file for doing so). Load/run the .out file.
The Visual C
This project is also tested using RTDX with Visual C
++
++
support files are on the CD. Access/run the VC
++
application
file vc_spectrogram.exe . You should get the Visual C
dialog message in
Figure 10.16 until MATLAB plots the spectrogram of a real-time input signal.
Input/play the ( .wav ) chirp signal and verify that the results are identical to those
++
Search WWH ::




Custom Search