[SciPy-User] which FFT, convolve functions are the fastest one?

josef.pktd at gmail.com josef.pktd at gmail.com
Wed Nov 10 20:10:19 EST 2010


On Wed, Nov 10, 2010 at 7:53 PM, David <david at silveregg.co.jp> wrote:
> On 11/11/2010 08:41 AM, LittleBigBrain wrote:
>> Hi everyone,
>>
>> I found lots of implement of FFT and convolve
>> numpy.fft
>> scipy.fftpack
>> scipy.signal.fft (from the source, it seems all import from scipy.fftpack?)
>
> scipy.fftpack is faster than numpy.fft, scipy.signal.fft is the same as
> scipy.fftpack as you noticed.
>
>>> From the source, it looks like fftpack.convolve and signal.fftconvolve
>> all based on fftpack, then what is the difference between them?
>
> Different APIs (mostly for historical reasons AFAIK)
>
>> I take a glance at the lfilter.c, surprisingly it is a completely
>> naive implement via polynomial function. I hope I am wrong about this.
>
> No, you're right, it is a straightforward implementation of time-domain
> convolution.

Signal.lfilter is an IIR filter and does convolution only as a special
case, and only with "same" mode. I'm very happy with it, and wish we
had a real nd version.

One difference in the speed I found in references and using it,
without real timing:
fftconvolve is only faster if you have two long arrays to convolve,
not if a long array is convolved with a short array.

I think, there are also differences in performance depending on the
shapes of the arrays for nd.

Josef

>Note that it supports types beyond what LAPACK would
> support (integers, long double, python objects), but LAPACK has no
> convolution function anyway, so I am not sure to understand what you are
> refering to ?
>
> cheers,
>
> David
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



More information about the SciPy-User mailing list