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.

DSPF_sp_cfftr2_dit - wrong result

Hello,

I am really sorry this question appears again, I have seen it on maybe thousand forums but I am already desperate trying to find solution.

My problem is, output of this function (DSPF_sp_cfftr2_dit (float * x, float * w, short n) is not the same as in Matlab for the same input.

Below I provide part of source code; you might think I have only forgotten to bit reverse the output, the thing is output is totally unexpected (for input of 1 and 127 zeros, would be Dirac impulse, expecting output 1+0j; result are just "random numbers"), also, I was trying to feed output of this function into ifft (from the same library) but it's output wasn't the same as original input.

If you could help me I would be very grateful, thanks in advance

Part of source code:

#define LENGTH (64)

float a[2*LENGTH] = {1, 0};            // input signal

float w[LENGTH] = {0};                    // twiddle factor array

gen_w_r2(w, LENGTH);
bit_rev(w, (LENGTH)>>1);
DSPF_sp_cfftr2_dit(a, w, LENGTH);
DSPF_sp_icfftr2_dif(a, w, LENGTH);
divide(a, LENGTH);

PS: my guess is, twiddle factors are wrong (either gen_w_r2 output or reversal output), I somehow can't figure out how to verify since here we have 1D output array and normally I can find only 2D arrays so I am confused.