1
$\begingroup$

Essentially this is the problem:

$\hat{F}(\omega) = \int_0^{\infty} f(s)e^{-i\omega s}ds$

The function $f$ is in general complex valued. I know this looks like the fourier transform but I don't want to view it that way. So in my implementation $f(s)$ and $\omega$ are going to be numpy vectors representing the sampled values of the true function or range. For my purposes I want to evaluate the integral for

omega = np.linspace(-30,30,0.1)

i.e. $-30\le\omega \le30$ with spacing of $0.1$

Can someone suggest a python implementation for this? I have done some quick research and some sources suggest using 'Gauss Laguerre' integration routine. I'm not sure why, but if someone could motivate this I would be grateful.

$\endgroup$
4
$\begingroup$

Even if you don't want to interpret the results as a Fourier transform, can't you make use of the builtin FT routines in numpy as an efficient way to evaluate the integral?

$\endgroup$
  • $\begingroup$ Thanks for your comment. For this case yes, but in the general case the exponent may be different to what the FT dictates. $\endgroup$ – Dipole May 29 '14 at 15:58
  • $\begingroup$ Well, what would that exponent be then? The way you phrase the question means that your computing a Fourier transform, and there are very efficient ways to do that. If you want something else, it would be useful to state what "something else" is in your question. $\endgroup$ – Wolfgang Bangerth May 30 '14 at 2:02

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.