Quadrature integration for complex function in R or Python

Viewed 143

Is there any function in R or Python based on quadrature to integrate the form of $$ \int ^{\inf}{-\inf} e^{-it} f(t) dt $$ or $$ \int ^{\inf}{-\inf} sin(t) f(t) dt$$ and $$ \int ^{\inf}_{-\inf} sin(t) f(t) dt$$ using quadrature?

Is there a function in either R or Python based on quadrature to integrate the form of or

1 Answers

Well, if you rewrite it as

F(w)= S exp-i w t f(t) dt, where S is integration sign, then this would be Fourier transform modulo some constants.

Then F(1) will produce value of the asked integral.

I would suggest with proper f(t) discretization use FFTW library or try NumPy FFT

Related