Digital Signal Processing Reference
In-Depth Information
signal analyzer). Since an output occurs every T s , the time interval for 32 points cor-
responds to 32 T s , or 32(0.125 ms)
4 ms. A negative spike is then repeated every
4 ms. This provides a reference, since the time interval between the two negative
spikes corresponds to the sampling frequency of 8 kHz. The center of this time inter-
val then corresponds to the Nyquist frequency of 4 kHz (2 ms from the negative
spike). The first positive spike occurs at 1 ms from the first negative spike. This
corresponds to a frequency of f
=
2 kHz. The second positive spike occurs at
3 ms from the first negative spike and corresponds to the folding frequency of
F s
=
F s /4
=
6kHz.
Change FREQ to 4 in order to select eight sine data values within the table. Verify
that the output is a 1-kHz signal (obtain a plot similar to that in Figure 6.14 from
an oscilloscope). A FREQ value of 12 produces an output of 3 kHz. A FREQ value of
15 shows the two positive spikes at the center (between the two negative spikes).
Note that aliasing occurs for frequencies larger than 4 kHz. To illustrate that, change
FREQ to a value of 20. Verify that the output is an aliased signal at 3 kHz, in lieu of
5kHz.A FREQ value of 24 shows an aliased signal of 2 kHz in lieu of 6 kHz.
The number of cycles is documented within the function cfftr2_dit.sa (by
TI) as
-
f
=
Cycles = ((2N) + 23)log 2 (N) + 6
For a 1024-point FFT, the number of cycles would be (2071) (10)
+
6
=
20,716. This
corresponds to a time of t
=
20,716 cycles/(225 MHz)
=
92
m
s.
Example 6.4: FFT of Real-Time Input Using TI's C-Callable
Optimized Radix-2 FFT Function ( FFTr2 )
This example expands Example 6.3 for real-time external input in lieu of a sine table
as input. Figure 6.17 shows a listing of the C source program FFTr2.c that imple-
ments this project. The same FFT support files are used as in Example 6.3: TI's
radix-2 optimized FFT function ( cfftr2_dit ), the function for generating the
index for bit reversal ( digitrev_index ), and the function for the bit reversal pro-
cedure ( bitrev ). Since the FFT function assumes that the twiddle constants are in
reverse order while the input data are in normal order, the index generation and
bit reversal associated with the twiddle constants are performed (as in Example 6.3)
before the complex FFT function is invoked.
Build this project as FFTr2 . Input a 2-kHz sinusoidal signal with an approximate
amplitude of 2 V p-p and verify the results in Figure 6.18. These results are similar
to those in Example 6.2.
A project application in Chapter 10 makes use of this example to display a
spectrum to a bank of LEDs connected to the DSK through the EMIF 80-pin
connector.
Search WWH ::




Custom Search