Analog Devices adsp-2100 Manual page 315

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

14 Software Examples
FFT, you change the value of these constants and the twiddle factors.
The data buffers twid_real and twid_imag in program memory hold the
twiddle factor cosine and sine values. The inplacereal, inplaceimag,
inputreal and inputimag buffers in data memory store real and imaginary
data values. Sequentially ordered input data is stored in inputreal and
inputimag. This data is scrambled and written to inplacereal and
inplaceimag. A four-location buffer called padding is placed at the end of
inplaceimag to allow data accesses to exceed the buffer length. This buffer
assists in debugging but is not necessary in a real system. Variables (one-
location buffers) named groups, bflys_per_group, node_space and
blk_exponent are declared last.
The real parts (cosine values) of the twiddle factors are stored in the buffer
twid_real. This buffer is initialized from the file twid_real.dat. Likewise,
twid_imag.dat values initialize the twid_imag buffer that stores the sine
values of the twiddle factors. In an actual system, the hardware would be
set up to initialize these memory locations.
The variable called groups is initialized to N_div_2, and bflys_per_group
and node_space are each initialized to 2 because there are two butterflies
per group in the second stage of the FFT. The blk_exponent variable is
initialized to zero. This exponent value is updated when the output data is
scaled.
After the initializations are complete, two subroutines are called. The first
subroutine places the input sequence in bit-reversed order. The second
performs the FFT and calls the block floating-point scaling routine.
.MODULE/ABS=4
.CONST
.VAR/PM/RAM/CIRC
.VAR/PM/RAM/CIRC
.VAR/DM/RAM/ABS=0
[4];
.VAR/DM/RAM/ABS=H#1000
.VAR/DM/RAM
.INIT
.INIT
.INIT
.INIT
14 – 12
dit_fft_main;
N=1024, N_div_2=512; {For 1024 points}
twid_real [N_div_2];
twid_imag [N_div_2];
inplacereal [N], inplaceimag [N], padding
inputreal [N], inputimag [N];
groups, bflys_per_group, node_space,
blk_exponent;
twid_real: <twid_real.dat>;
twid_imag: <twid_imag.dat>;
inputreal: <inputreal.dat>;
inputimag: <inputimag.dat>;

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents