Search Comments and Ratings

go

   
Date File Comment by Comment Rating
13 Apr 2014 fft fft code written my me Author: ustc huan Zongge

Zongge (view profile)

1
30 Mar 2009 fft fft code written my me Author: ustc huan Hal 9000

This file is full of garbage. How is this supposed to run?

1
30 Mar 2009 fft fft code written my me Author: ustc huan Duane Hanselman

Why is the Database Toolbox required? Here is what is in this file:
function xn=myfft(x)
N=length(x);%È¡Êý×鳤¶È
M=log2(N);%ÇóÊý×鳤¶ÈÒÔ2Ϊµ×µÄÃÝ
%´Ë´¦½«Êý×éxÅÅÐò³Éxtmp
%»ù±¾Ë¼Ï룺½«Ã¿Î»x(i)ÖеÄiµÄÖµ»»Ëã³É2½øÖÆ£¬Ã¿´Î½«×îµÍλȡ³ö±£´æµ½³¤¶ÈΪMµÄÊý×éÖÐ
%¸ÃÊý×éµÄ´ÓµÚMλµ½µÚ1λÅÅ¿ª¾ÍÊÇÅÅÐòºóµÄλÖõĶþ½øÖƱíʾ
%½«¸ÃÊý×é»»Ëã³ÉÊ®½øÖƵÄÊý¾ÍÊÇÐòÊýÖØÅźóµÄÐòÊýpos£¬ÔÙ½«x(i)¸³Óèxtmp(pos)
%ÓÉÓÚmatlabÖÐÊý×é´Ó1¿ªÊ¼£¬¹ÊӦΪx(pos+1)=x(i+1)
xtmp=zeros(1,N);
value=zeros(1,M);
for i=0:N-1
repr=i;
for t=1:1:M
repr=bitshift(i,1-t);
value(t)=bitand(repr,1);
end
pos=0;
for k=1:1:M
pos=pos+value(k)*2^(M-k);
end
xtmp(pos+1)=x(i+1);
end
%xtmp=x;

%fftÖ÷º¯Êý
%Ö÷Ҫ˼Ï룺¹²ÓÐM²ã¼ÆËã
%ÿ²ã°üÀ¨width¿é¼ÆË㣬ÿ¿é¼äÏà¾à2^iµÄ¾àÀ루iΪµÚi²ã£©
%ÿ¿é¼ÆËã°üÀ¨deepth¸öµûÐÎÔËËã
for i=1:M
deepth=2^(i-1);
width=2^(M-i);
for t=1:2^i:N
for k=1:deepth
tmp=xtmp(t+k-1);
wn=width*(k-1);
xtmp(t+k-1)=tmp+exp(-j*2*pi*wn/N)*xtmp(t+k+deepth-1);
xtmp(t+k+deepth-1)=tmp-exp(-j*2*pi*wn/N)*xtmp(t+k+deepth-1);
end
end
end
xn=xtmp;

1

Contact us