[SciPy-Dev] fftpack.convolve.convolve

Clemens Novak clemens@familie-novak....
Fri Aug 16 05:36:51 CDT 2013


Hi,

I've been working on extending the fftpack tutorial page (you can see 
the current status here: 
https://github.com/ClemensFMN/scipy/blob/tut_fft/doc/source/tutorial/fftpack.rst 
) and I stumbled across the function fftpack.convolve.convolve .

Sorry the blunt question, but what does this function do? From the name 
I'd assume that it calculates the convolution of two sequences (as 
convolve in scipy.signal does) using the fft (since it is part of 
fftpack), but appearently it doesn't:

import numpy as np
import scipy.fftpack.convolve as conv
import scipy as sp
import scipy.signal as sig


x = np.array([1.0, 0.0, 0.0])
h = np.array([1.0, 2.0, 3.0])

y1 = conv.convolve(x, h)
[ 5. -1. -1.]

y2 = sig.convolve(x, h)
[ 1.  2.  3.  0.  0.]

y3 = sp.ifft(sp.fft(x) * sp.fft(h))
[ 1.+0.j  2.+0.j  3.+0.j]

Does the function extend its first and/or second argument to a periodic 
sequence and perform then the convolution (I tried some ideas but that 
didn'twork either)? It would be great if someone could please provide 
some insight...

Regards - Clemens


More information about the SciPy-Dev mailing list