跪求用VC语言编写信号傅里叶转换程序的源代码!

来源:百度知道 编辑:UC知道 时间:2024/06/20 14:47:19
跪求用VC语言编写信号傅里叶转换程序的源代码! 最好有一些注解 或者思路!!谢谢!!!!

一维的:
void FFT1(float a_r1[],float a_im[],int ex,bool inv)
{
int i,length=1;
float *sin_tbl;
float *cos_tbl;
float *buf;

for(i=0;i<ex;i++)
{
length*=2;
}

sin_tbl=(float *)malloc(length*sizeof(float));
cos_tbl=(float *)malloc(length*sizeof(float));
buf=(float *)malloc(length*sizeof(float));

cstb(length,inv,sin_tbl,cos_tbl);
fft1core(a_r1,a_im,length,ex,sin_tbl,cos_tbl,buf);

free(sin_tbl);
free(cos_tbl);
free(buf);
}

二维的:
void FFT2(float *a_rl,float *a_im,bool inv,int xsize,int ysize)
{
float *b_rl,*b_im;
float *hsin_tbl,*hcos_tbl,*vsin_tbl,*vcos_tbl;
float *buf_x,*buf_y;
int i;

b_rl=(float *)calloc(xsize*ysize,sizeof(float));
b_im=(float *)calloc(xsize*ysize,sizeof(float));
hsin_tbl=(float *)calloc(xsize,sizeof(float));
hcos_tbl=(float *)calloc(xsize,sizeof(float));
vs