C6455做FFT。用的void DSP_fft32x32(int *w, int nx, int *x, int *y)对[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]作傅里叶变换测试。 先用tw_fft32x32 产生了旋转因子。为什么最后求出的FFT数据不对?除了第一个对。还有输出的都是整数吗?
求大神给个例程,给出点建议。确实卡这很久了。
#include "stdio.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
#include "ctype.h"
#define NSize 16
#pragma DATA_SECTION (twiddle_factor, "mysect");
#pragma DATA_ALIGN (twiddle_factor, 8)
int twiddle_factor[NSize*2];
#pragma DATA_SECTION (PImgTmp_double, "mysect");
#pragma DATA_ALIGN (PImgTmp_double, 8)
int PImgTmp_double[NSize*2]={1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0,14,0,15,0,16,0};
#pragma DATA_SECTION (FFT_output, "mysect");
#pragma DATA_ALIGN (FFT_output, 8)
int FFT_output[NSize*2];
int gen_twiddle(int *w, int n, double scale);
void DSP_fft32x32(int *w, int nx, int *x, int *y);
void main()
{
gen_twiddle(twiddle_factor, NSize, 2147483647.5);
DSP_fft32x32(twiddle_factor,NSize,PImgTmp_double,FFT_output);
}
|