Effacer les filtres
Effacer les filtres

simple fft code problem

1 vue (au cours des 30 derniers jours)
ayman osama
ayman osama le 3 Déc 2012
x=rand(1,8);
for k=1:8
for m=1:8
l(m)=x(m)*exp(-i*2*pi*k*m/8);
end
X(k)=sum(l);
end
X=X
I used this code to implement the fast Fourier transform but it didn't work. Is there any help?
  2 commentaires
Matt J
Matt J le 3 Déc 2012
This is closer to the DFT than the FFT.
Azzi Abdelmalek
Azzi Abdelmalek le 3 Déc 2012
It's right, this is 'nt FFT algorithm, but the FFT is just a faster way to calculate a DFT. the result will be the same

Connectez-vous pour commenter.

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 3 Déc 2012
Modifié(e) : Azzi Abdelmalek le 3 Déc 2012
%k and m start at 0
x=rand(1,8);
for k=0:7
for m=0:7
l(m+1)=x(m+1)*exp(-i*k*m*pi/4);
end
X(k+1)=sum(l);
end
%or
R=exp(-i*2*pi/8)
k=0:7;
XX=exp(-i*pi/4).^(k'*k)*x'
Remark: for big array, you must use FFT algorithm
  2 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 3 Déc 2012
compare the result with fft(x), it's the same
ayman osama
ayman osama le 3 Déc 2012
thank u for help

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by