Need help in understanding the following FFT code (line %1 to %4)
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Transforms dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!