资源描述:
《信号分析与处理,离散傅里叶变换与反变换》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、#includeMmath.h"}#include"stdio.h"K=N»1;#defineswap(a,b);T=(a);(a)=(b);(b)=Twhile(K>=2&&J>=K)voidIfft(floatAU,floatBU,unsignedM);J-=K;K»=l;main()}{J+=K;floatA[1024],B[1024];}unsignedlongN,I;for(L=1;L<=M;L++)unsignedM;{printf("inputM=");LE=1«L;scanf(”%d“,&M);LEl=LE/2;N=1«M;Wr
2、=1.0;printf(,,H);Wi=0.0;printf(,,inputAn:H);theta=-3.1415926536/LEl;for(I=0;I3、+jB[I]:”);Tr=Wr*ALQ]-Wi*B[QJ:printf(nM);Ti=Wr*B[Q]+Wi*A[Q]for(I=0;I4、P,Q,R;Wi=WTr*Wli+WTi*Wlrfloat}Wr,Wi,W1r,Wli,WTr,WTi,theta,Tr,Ti;N=1«M;J=0;}for(I=0;II)}{floatT;swap(A[I],A[J]);—►swap(B[I],B[J]);#include"math.h,'#include"stdio.h"#defineswap(a,b);T=(a);(a)=(b);(b)=TvoidIfft(floatAf],floatBf],unsignedM);main(){floatA[10
5、24],B[1024];unsignedlongN,I;unsignedM;printf(HinputM=H);scanf(”%d“,&M);N=1«M;printf(,,u);printf("inputA[]:n);for(I=0;I6、;I++)printfC%.3f+j(%.3f)“,A[I],B[I]);printf(nu);voidIfft(floatA[],floatB[],unsignedM){unsignedlongN,1,J,K,L,LE,LE1,P,Q,R;floatWr,Wi,W1r,W1i,WTr,WTi,theta,Tr,Ti;N=1«M;J=0;for(I=0;I=2&&J>=K){J-=K;K»=l;}J+=K;}for(L=1;L<=M;L++){LE=1«L;LEl=LE/2;Wr=1.0;W
7、i=0.0;theta=3.1415926536/LEl;Wlr=cos(theta);Wli=sin(theta);for(R=0;RI){floatT;swap(A[I],A
8、[J]);)swap(B[lJ,B[JJ);#include#include#defineQ3.1415926voi