DIT
FFT_matlab 算法实现与验证
一、算法代码:
DIT_FFT_algorithm:
clear,clc,
clear all;
xn=[0,1,2,3,4,5,6,7];
N=length(xn);
A=xn;
%DIT_FFT
NI=N/2;
for I=1:N-1
if I
t=A(I+1);
A(I+1)=A(NI+1);
A(NI+1)=t;
end
T=N/2;
while NI>=T
NI= NI-T;
T=T/2;
end NI= NI+T;
end
disp('逆序x[n]:'),disp(A);
%butterfly
WN=exp(-i*2*pi/N);
v=floor(log2(N));
for m=1:v
for k=0:2^m:N-1
for K=0:2^(m-1)-1
p=k+K;
q=p+2^(m-1);
r=2^(v-m)*mod(p,2^m);
B(p+1)=A(p+1)+A(q+1)*WN^r;
B(q+1)=A(p+1)-A(q+1)*WN^r;
end
end A=B;