hi, recently I'am learning about the FFT. I have some questions about the example code given in the ifft_fr16(...) help document. The example code is as follows:

complex_fract16 out_cfft[N_FFT];

complex_fract16 out_ifft[N_FFT];

complex_fract16 twiddle[N_FFT/2];

twidfftrad2_fr16(twiddle, N_FFT);

/* Compute Fast Fourier Transform */

cfft_fr16(in, out_cfft, twiddle, 1, N_FFT, &blk_exp, 0);

/* Reverse static scaling applied by cfft_fr16() function

Apply the shift operation before the call to the

ifft_fr16() function only if all the values in out_cfft

= 0x100. Otherwise, perform the shift operation after the

ifft_fr16() function has been computed.

out_cfft[i].re = out_cfft[i].re << 6; /* log2(N_FFT) = 6 */

out_cfft[i].im = out_cfft[i].im << 6;

/* Compute Inverse Fast Fourier Transform

The output signal from the ifft function will be the same

as the DC signal of magnitude 0x100 which was passed into

ifft_fr16(out_cfft, out_ifft, twiddle, 1, N_FFT, &blk_exp, 0);

Here is my question:

(1)as the document said, cfft_fr16 will scale the intermediate result according to the scale mode to prevent overflow. But there is a for-loop following the cfft_fr16 function, I think the result will be overflow again. I can't understand it.

(2) the annotation part that just above the for-loop say if all the values in out_cfft = 0x100, user should apply the shift operation before the call to the ifft_fr16, otherwise, perform the shift operation after the call to ifft_fr16. What is the reason? In fact, I put the shift code after the call to the ifft_fr16, I also get the right result.

(3)when I change the N_FFT >=256, the result turns to be 0.

(4)Sometimes I think we should apply the shift operation after the call to cfft_fr16 and the call to ifft_fr16, cause the two function both scale the intermediate results. But it won't be correct, right? cause with just one shift operation, we get the right result. I just can't understand it.

(5)when I change the scale mode to 2 and 3, and 6 in for-loop to blk_exp, neither I put the shift code before the call to ifft_fr16 nor I put the shift code after the call to ifft_fr16 wouldn't get the right answer.

Thanks in advance.