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.
Hello,
I am trying to use the dsplib build in function (c674x dsplib_v10) of fft and inverse fft.
When I perform transform in a single pass implementation, it works, for array of 128 complex values, but when I try multipass implementation for 512 complex values in radix 4 format, I get QNaN values in arrays after fft transform.
This is the code I use for multipass implementation:
Cmplx_input1() is an input array with real and imaginary values at even and odd indices, respectively. FFT_input1() is output array. N_B = 512 is a length of an array in complex values. a twiddle_factor() is calculated for full array of N_B values from function given in library. brev is an array also given in library.
DSPF_sp_fftSPxSP (N_B, &Cmplx_input1[0], &twiddle_factor[0], FFT_input1, brev, N_B/2, 0, N_B);
DSPF_sp_fftSPxSP (N_B, &Cmplx_input1[2*3*N_B/4], &twiddle_factor[2*3*N_B/4], FFT_input1, brev, 4, N_B*3/4, N_B);
DSPF_sp_fftSPxSP (N_B, &Cmplx_input1[2*2*N_B/4], &twiddle_factor[2*3*N_B/4], FFT_input1, brev, 4, N_B*2/4, N_B);
DSPF_sp_fftSPxSP (N_B, &Cmplx_input1[2*1*N_B/4], &twiddle_factor[2*3*N_B/4], FFT_input1, brev, 4, N_B*1/4, N_B);
DSPF_sp_fftSPxSP (N_B, &Cmplx_input1[0], &twiddle_factor[2*3*N_B/4], FFT_input1, brev, 4, 0, N_B);
DSPF_sp_ifftSPxSP (N_B, &Cmplx_input1[0], &twiddle_factor[0], FFT_input1, brev, N_B/2, 0, N_B);
DSPF_sp_ifftSPxSP (N_B, &FFT_input1[2*3*N_B/4], &twiddle_factor[2*3*N_B/4], Cmplx_input1, brev, 4, N_B*3/4, N_B);
DSPF_sp_ifftSPxSP (N_B, &FFT_input1[2*2*N_B/4], &twiddle_factor[2*3*N_B/4], Cmplx_input1, brev, 4, N_B*2/4, N_B);
DSPF_sp_ifftSPxSP (N_B, &FFT_input1[2*1*N_B/4], &twiddle_factor[2*3*N_B/4], Cmplx_input1, brev, 4, N_B*1/4, N_B);
DSPF_sp_ifftSPxSP (N_B, &FFT_input1[0], &twiddle_factor[2*3*N_B/4], Cmplx_input1, brev, 4, 0, N_B);
All the arrays is of size N_B*2
Please help
Thanks
Arye
Please disregard the code in first message, it was mistaken:
// foward part:
DSPF_sp_fftSPxSP (N_B, &Cmplx_input1[0], &twiddle_factor[0], FFT_input1, brev, N_B/4, 0, N_B);
DSPF_sp_fftSPxSP (N_B/4, &Cmplx_input1[2*3*N_B/4], &twiddle_factor[2*3*N_B/4], FFT_input1, brev, 4, N_B*3/4, N_B);
DSPF_sp_fftSPxSP (N_B/4, &Cmplx_input1[2*2*N_B/4], &twiddle_factor[2*3*N_B/4], FFT_input1, brev, 4, N_B*2/4, N_B);
DSPF_sp_fftSPxSP (N_B/4, &Cmplx_input1[2*1*N_B/4], &twiddle_factor[2*3*N_B/4], FFT_input1, brev, 4, N_B*1/4, N_B);
DSPF_sp_fftSPxSP (N_B/4, &Cmplx_input1[0], &twiddle_factor[2*3*N_B/4], FFT_input1, brev, 4, 0, N_B);
// inverse part:
DSPF_sp_ifftSPxSP (N_B, &FFT_input1[0], &twiddle_factor[0], Cmplx_input2, brev, N_B/4, 0, N_B);
DSPF_sp_ifftSPxSP (N_B/4, &FFT_input1[2*3*N_B/4], &twiddle_factor[2*3*N_B/4], Cmplx_input2, brev, 4, N_B*3/4, N_B);
DSPF_sp_ifftSPxSP (N_B/4, &FFT_input1[2*2*N_B/4], &twiddle_factor[2*3*N_B/4], Cmplx_input2, brev, 4, N_B*2/4, N_B);
DSPF_sp_ifftSPxSP (N_B/4, &FFT_input1[2*1*N_B/4], &twiddle_factor[2*3*N_B/4], Cmplx_input2, brev, 4, N_B*1/4, N_B);
DSPF_sp_ifftSPxSP (N_B/4, &FFT_input1[0], &twiddle_factor[2*3*N_B/4], Cmplx_input2, brev, 4, 0, N_B);
It does not gives Qnan now, but the conversion still is totaly wrong.
This code is the same as in SPRA947a, wheere the example is given on fft only. I assumed that inverse fft will be of the same format... or not?
Thanks
Arye
The same problem guy, it looks does not work
It pass fthe irst time but any next time it returns the same value(***)
Hi,
I sort of figured that out.
You need to define some of the arrays you use as double word alligned. If I understand it right, it uses space in between for calculations. That can explain the data being written back to the array if not alligned.
Anyway, just define the arrays that need to be alligned (look at the function description) as:
#pragma DATA_ALIGN(buffer, 128) // or 64 instead of 128
float buffer[SIZE];
Regards
Arye