Texas Instruments TMS320C64X User Manual

Page 137

Advertising
background image

DSP_fft16x16t

4-109

C64x+ DSPLIB Reference

/*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/

/* Determine the magnitude od the number of points to be transformed. */

/* Check whether we can use a radix4 decomposition or a mixed radix */

/* transformation, by determining modulo 2. */

/*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/

for (i = 31, m = 1; (npoints & (1 << i)) == 0; i−−, m++) ;

radix = m & 1 ? 2 : 4;

norm = m − 2;

/*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/

/* The stride is quartered with every iteration of the outer loop. It */

/* denotes the seperation between any two adjacent inputs to the butter */

/* −fly. This should start out at N/4, hence stride is initially set to */

/* N. For every stride, 6*stride twiddle factors are accessed. The */

/* ”tw_offset” is the offset within the current twiddle factor sub− */

/* table. This is set to zero, at the start of the code and is used to */

/* obtain the appropriate sub−table twiddle pointer by offsetting it */

/* with the base pointer ”ptr_w”. */

/*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/

stride = npoints;

tw_offset = 0;

fft_jmp = 6 * stride;

while (stride > radix)

{

/*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/

/* At the start of every iteration of the outer loop, ”j” is set */

/* to zero, as ”w” is pointing to the correct location within the */

/* twiddle factor array. For every iteration of the inner loop */

/* 6 * stride twiddle factors are accessed. For eg, */

/* */

/* #Iteration of outer loop # twiddle factors #times cycled */

/* 1 6 N/4 1 */

/* 2 6 N/16 4 */

/* ... */

/*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/

j = 0;

fft_jmp >>= 2;

Advertising