Is ifft(fft(x).*fft(h)) faster or conv(x,h) ?

55 vues (au cours des 30 derniers jours)
Alim Huseynov
Alim Huseynov le 1 Déc 2017
Commenté : Rik le 11 Mar 2020
Dear All,
I need to find out which one is faster to obtain convolution? - Linear convolution using just 'conv'? - or Obtaining Convolution from ifft(fft)? As far as I have coded and identified using tic/toc, that Matlab performs linear convolution faster than ifft(fft). But textbooks say fft is faster.
  4 commentaires
Rik le 11 Mar 2020
Just a note: format LONGENG will not increase calculation precision, it will only affect how values are shown in the command window.

Connectez-vous pour commenter.

Réponses (2)

Rik le 11 Mar 2020
Why would a textbook say ifft(fft()) is faster? That doens't make sense. If that was the case, Mathworks would have implemented conv a bit like this:
function out=conv(x,h)
The mere fact that they didn't should tell you the real conv function is faster than the one I put here.

Honglei Chen
Honglei Chen le 11 Mar 2020
Time is not the best way to compare the two approaches. Rather, the best approach to describe is the computation complexity, i.e., when the size of the signal increases, how does the time of computation increases accordingly. It is in this comparison that the FFt approach shows the advantage. The theory should be available in any standard DSP text book and here is a webpage for a summary
  1 commentaire
Rik le 11 Mar 2020
I would expect the implementation in Matlab to be a black box: it is not relevant if internally there is an FFT or direct approach, as long as it gives the correct output. That is true in general for internal functions. Your comment about computational complexity still holds, but I expect the Mathworks employees that engineered the conv function to know about this.

Connectez-vous pour commenter.


En savoir plus sur Fourier Analysis and Filtering 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!

Translated by