Digital Signal Processing Reference
In-Depth Information
order, while the FFT coefficients or twiddle constants are in reverse order. As a
result, the support function digitrev_index.c , to produce the index for bit
reversal, and bitrev.sa , to perform the bit reversal on the twiddle constants, are
called before the FFT function is invoked. These two support files for bit reversal
are again called to bit-reverse the resulting scrambled output.
N is the number of complex input (note that the input data consist of 2 N ele-
ments) or output data, so that an N -point FFT is performed. FREQ determines the
frequency of the input sine data by selecting the number of points per cycle within
the data table. With FREQ set at 8, every eighth point from the table is selected,
starting with the first data point. The modulo operator is used as a flag to reinitial-
ize the index. The following four points (scaled) within one period are selected: 0,
1000, 0, and
1000. Example 2.4 ( sine2sliders ) illustrates this indexing scheme
to select different number of data points within a table.
The magnitude of the resulting FFT is taken. The line of code
-
output_sample (32000);
outputs a negative spike (not positive, due to the 2's-complement format of the
AIC23 codec). It is used as a reference scheme. The input data are scaled so that
the output magnitude is positive (again due to the codec data format). The sampling
rate is achieved through polling.
Build and run this project as FFTsinetable . The two support files for bit rever-
sal and the complex FFT function also are included in the Source project. Figure
6.16 shows a time-domain plot of the resulting output (obtained with an HP dynamic
FIGURE 6.16. Time-domain plot representing the magnitude of the FFT of a 2-kHz input
data from a table obtained using TI's FFT function.
Search WWH ::




Custom Search