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!