1
$\begingroup$

I have an integral of a convolution between two functions. How can I calculate this in Python? It is a continuum convolution.

$\endgroup$
2
$\begingroup$

I think that you can use convolve() from scipy.signal. As mentioned in a previous question, you can take advantage that the Fourier Transform of a convolution represents a product.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Do you have any material that explain this things better? I will be gratefull! Btw, thanks for your help! :) $\endgroup$ – Brenda Pinheiro Apr 2 at 21:44
  • $\begingroup$ @BrendaPinheiro, sadly I don't. But you might want to check Wikipedia's article: en.wikipedia.org/wiki/Convolution_theorem $\endgroup$ – nicoguaro Apr 2 at 21:46
  • $\begingroup$ Thanks you! :)) $\endgroup$ – Brenda Pinheiro Apr 3 at 1:10
1
$\begingroup$

That depends on what kind of integral transform you are looking at.

Your comments suggest that you are looking at a Fourier transform specifically, so I would recommend the FFT implementation of NumPy. Using this approach you can also tackle Laplace transforms.

For the most general case you will have to evaluate your convolution using a brute force numerical quadrature appropriate for the type of integral you are trying to evaluate.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.