[SciPy-dev] scipy.signal.convolve2d very slow, why is it there exactly?

Joel Schaerer joel.schaerer@insa-lyon...
Mon Jul 28 04:13:23 CDT 2008

Hi all,

I had previously reported that signal.convolve2d was significantly slower than
matlab for the following code:



import scipy.io as io
import scipy.signal



for k in xrange(seq.shape[2]):



Turns out, I can get even better results than matlab by using fftconvolve
instead of convolve2d. The generic signal.convolve gives intermediary results, a
lot better than convolve2d but still slower than matlab. Here are the results of
my measurements for anyone interested:

convolve2d : 9 minutes
convolve : 3 minutes
matlab's conv2 : 1m2s
fftconvolve : 35s

So the question seems to be, why is convolve2d even there? It's very slow and
limited to 2D arrays. It's misleading to newcommers who might very well conclude
from its use that scipy is too slow to be useful.

More information about the Scipy-dev mailing list