Digital Signal Processing Reference
In-Depth Information
FIGURE 6.18. Time-domain plot of the radix-2 FFT magnitude of a 2-kHz sinusoidal input
signal using FFTr2.c .
Example 6.5: Radix-4 FFT of Input from a Lookup Table Using TI's
C-Callable Optimized FFT Function ( FFTr4_sim )
Figure 6.19 shows the C source program FFTr4_sim.c that calls TI's optimized FFT
function cfftr4_dif.sa (included on the CD) that performs a radix-4 complex
FFT. The program takes a 16-point FFT of an input sinusoidal signal from a lookup
table. The FFT support functions for this example are included on the CD. They are:
1. cfftr4_dif.sa : performs a DIF FFT in assembly code (not in linear ASM).
2. R4DigitRevIndexTableGen : generates the index for digit reversal.
3. digit_reverse : performs the digit reversal.
Note: The support files digitrev _ index and bitrev , included in TI's Web site, for digit
reversal do not work with the radix-4 FFT function. Use the functions included on
the CD.
Build this project as FFTr4_sim and load the program:
1. View the watch window for the array x , arranged as successive real and imag-
inary number pairs. Expand x and verify that the real component data values
are as in the lookup table and the imaginary components are all zeros. Place a
breakpoint at the line following the first call to the FFT function. Run the
program (execution stops at the set breakpoint). Verify that the FFT output is
scrambled since the digit-reversal function digit_reverse is not yet exe-
cuted. For example, x (4)
=
0
-
8000i should be swapped with x (1), x (6)
=
0
+
1.23i
0.68i should be swapped with x (13), and
so on (see Figure 6.11). Note that x (5) is in the proper address sequence.
2. Remove the set breakpoint and place one after the first call to the digit reverse
function (so that it is executed). Run the program again (to the set break-
should be swapped with x (9), x (7)
=
0
+
Search WWH ::




Custom Search