views:

664

answers:

3

Hi!

I will have to implement a convolution of two functions in Python, but SciPy/Numpy appear to have functions only for the convolution of two arrays.

Before I try to implement this by using the the regular integration expression of convolution, I would like to ask if someone knows of an already available module that performs these operations.

Failing that, which of the several kinds of integration that SciPy provides is the best suited for this?

Thanks!

+1  A: 

You could try to implement the Discrete Convolution if you need it point by point.

Andrea Ambu
+1  A: 

What is the dimension of the domain of your functions? 1D, 2D, 3D...? If it is 1D, array convolution should be enough for you, as Andrea pointed.

At page 46 of this PDF , from Pete Carswell, there is an example that may be useful for you.

The full course handouts are available here

proportional
+1  A: 

Yes, SciPy/Numpy is mostly concerned about arrays.

If you can tolerate an approximate solution, and your functions only operate over a range of value (not infinite) you can fill an array with the values and convolve the arrays.

If you want something more "correct" calculus-wise you would probably need a powerful solver (mathmatica, maple...)

peufeu