How to optimise fft?

4 views (last 30 days)
Jingwen Ding
Jingwen Ding on 2 Apr 2019
Hi,
I was trying to do fast fourier transform after applying a hanning window on my input signal (600 points). I was using code "Xk=fft(signal.*window1);" and it will return me 600x1 array as an outpout. However, I found that it took more than 100us to complete this line of code. Is there any way I can optimise 'fft()' function?
Many thanks.

Answers (1)

Sebastien Dupertuis
Sebastien Dupertuis on 31 Jul 2019
Hi Jingwen,
One solution to optimize the execution of some MATLAB code/function is to use the MATLAB Coder to generate a MEX (MATLAB Executable). If the implementation of the function is already optimal, you will not get much improvement, and this is the case with the fft function.
Another solution could be to use the Parallel Computing toolbox, but in the case of the fft function it will not help as its implementation is already multi-threaded.
I have attached an example with MEX generation that is directly linked to your application and you can see that you cannot better improve the execution time of the fft function.
Thanks,
Sebastien

Community Treasure Hunt

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

Start Hunting!