Digital Signal Processing Reference
In-Depth Information
FIGURE 6.14. Time-domain plot representing the magnitude of the FFT of a 2 kHz real-
time input sinusoid.
A project application in Chapter 10 makes use of this example to display a spec-
trum to LCDs, connected to the DSK through the EMIF 80-pin connector.
Example 6.3: FFT of a Sinusoidal Signal from a Table Using TI's C
Callable Optimized FFT Function ( FFTsinetable )
Figure 6.15 shows a listing of the program FFTsinetable.c , which illustrates a
C program calling TI's optimized floating-point FFT function cfftr2_dit.sa ,
available at TI's Web site (also on CD). The twiddle constants are calculated within
the program. The imaginary components of the twiddle constants are negated, as
required (assumed) by the FFT function. The FFT function also assumes N /2
complex twiddle constants. It is important to align the data in memory (on an 8-
byte boundary). Both the input data and the twiddle constants are structured as
“complex.”
The input signal consists of sine data values set in a table as real input data. The
imaginary components of the input sine data are set to zero. The input data are
arranged in memory as successive real and imaginary number pairs, as required
(assumed) by the FFT function. The resulting output is still complex.
The FFT function cfftr2_dit.sa uses a DIT, radix 2, and takes the FFT
of a “complex” input signal. Two support functions, digitrev_index.c and
bitrev.sa , are used in conjunction with the complex FFT function for bit rever-
sal. These two support files are also available through TI's Web site (also on CD).
The FFT function cfftr2_dit.sa assumes that the input data x are in normal
Search WWH ::




Custom Search