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 Answers 2

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.

$\endgroup$
2
  • $\begingroup$ Do you have any material that explain this things better? I will be gratefull! Btw, thanks for your help! :) $\endgroup$ Apr 2, 2020 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, 2020 at 21:46
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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