/*required for bit reversing the output of the fft fxn*/
DSPF_sp_bitrev_cplx((double*)workbuf,bit_rev_table,nFFT);
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Did you bit-reverse your twiddle table? Here's some code I got working several years ago:
old code said:// In the following code 'n' is the FFT size as given in
// complex samples, i.e. there are 2*n floats with the
// even numbered floats representing the real part and
// the odd numbered floats representing the imaginary part
void fft_r2_init(float *w1, int n, short *br_table)
{
int i;for(i=0; i<n; i++) // initialize bit-rev table to zero
br_table[ i ] = 0;bitrev_index(br_table, n);
gen_twiddle(w1, n); // generate twiddle table of n/2 complex twiddles
DSPF_sp_bitrev_cplx((double *)w1, br_table, n/2); // put twiddle table in bit-reversed order
}
void fft_r2(float *x1, float *w1, int n, short *br_table)
{
DSPF_sp_cfftr2_dit(x1, w1, n); // in-place FFT
DSPF_sp_bitrev_cplx((double *)x1, br_table, n);
}
Make sure you get the sizes write. Specifically when you bit-reverse the twiddle table make sure you pass n/2.
Brad