已回答假定已回答

傅里叶变换和逆变换问题

linshenghuan 在 2016-10-10 詢問的問題
最後回覆由Rocky2016於2016-10-21提供

/* Compute IFFT( CFFT( X ) ) = X */

#include <filter.h>

 

#define N_FFT 64

complex_fract16 in[N_FFT];

complex_fract16 out_cfft[N_FFT];

complex_fract16 out_ifft[N_FFT];

complex_fract16 twiddle[N_FFT/2];

int blk_exp;

 

void ifft_fr16_example(void)

{

int i;

/* Generate DC signal */

for( i = 0; i < N_FFT; i++ )

{

in[i].re = 0x100;

in[i].im = 0x0;

}

 

/* Populate twiddle table */

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.

*/

for( i = 0; i < N_FFT; i++ )

{

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

the cfft function.

*/

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

}

 

为什么fft函数在 bf592中运行 out_ifft 数据和in数据有区别??? 傅里叶变换和逆变换的 结果有差距呢

結果