How to compute FFT?

Hi there
I just would like to ask, if there is an efficient way to compute the FFT without using the built-in method? Because i need the code on something else, so i found a code to compute it, however, it takes a very long time, so i would highly appreciate it if you could suggest me any way to make it more faster? thank you in advance
function z=Fast_Fourier_Transform(x,nfft)
%
j=sqrt(-1);
N=length(x);
z=zeros(1,nfft);
Sum=0;
for k=1:nfft
for jj=1:N
Sum=Sum+x(jj)*exp(-2*pi*j*(jj-1)*(k-1)/nfft);
end
z(k)=Sum;
Sum=0;% Reset
end
return

回答 (1 件)

John D'Errico
John D'Errico 2016 年 5 月 10 日

0 投票

Sorry. You are never going to make that code run as fast as FFT, or even reasonably close to it.
You can always look for a C based FFT code. There must be lots of them around.

1 件のコメント

Afnan H.
Afnan H. 2016 年 5 月 10 日
Thank you for your answer. But could you please clear this for me, so you mean the problem with the code itself? or that i can't implement a code that computes FFT in a fast way using Matlab?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeFourier Analysis and Filtering についてさらに検索

タグ

質問済み:

2016 年 5 月 10 日

コメント済み:

2016 年 5 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by