
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... ) 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

Clemens Novak wrote:
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... ) 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 _______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-dev
AFAICT, fftpack.convolve exists in support of pseudo_diffs.py. Look there to see some examples. -Eric

On 2013-08-21 17:50, Eric Moore wrote:
Clemens Novak wrote:
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... ) 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 _______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-dev
AFAICT, fftpack.convolve exists in support of pseudo_diffs.py. Look there to see some examples.
-Eric
_______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-dev
Thanks for the input; I will have a look at the file. Clemens
participants (2)
-
Clemens Novak
-
Eric Moore