Need help in understanding the following FFT code (line %1 to %4)
조회 수: 1 (최근 30일)
이전 댓글 표시
function [ y ] = FFT_DIT_R2( x )
p=nextpow2(length(x));
x=[x zeros(1,(2^p)-length(x))];
N=length(x);
S=log2(N);
Half=1;
x=bitrevorder(x);
for stage=1:S;
for index=0:(2^stage):(N-1);
for n=0:(Half-1);
pos=n+index+1;
pow=(2^(S-stage))*n; %1
w=exp((-1i)*(2*pi)*pow/N); % 2
a=x(pos)+x(pos+Half).*w; % 3
b=x(pos)-x(pos+Half).*w; % 4
x(pos)=a;
x(pos+Half)=b;
end;
end;
Half=2*Half;
end;
y=x;
end
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Transforms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!