Numerical Approximation of the Continuous Fourier Transform

$\def \o {\omega}$ (Here I use $t$ and $\o$ instead $x$ and $k$, but is equivalent) We want to calculate numerically the inverse Fourier transform of a given function $F(\o)$ . By definition

$f(t)=\frac{1}{2\pi} \int_{-\infty}^{\infty} F(\o) e^{-i\o t} d\o $

We can split it into two integrals

$f(t)=\frac{1}{2\pi} \left( \int_{0}^{\infty} F(\o) e^{-i\o t} d\o + \int_{0}^{\infty} F(-\o) e^{i\o t} d\o \right) $

If the original function was real then $F(-\o)=F(\o)^{*}$, and therefore

$f(t)=\frac{1}{\pi} \textbf{real} \left( \int_{0}^{\infty} F(\o) e^{-i\o t} d\o \right)$

Then we use the Riemann integral definition for $0$ to a very great frequency $W$. $I=\int_{0}^{W} F(\o) e^{-i\o t} d\o\approx \sum_{k=0}^{N-1} F(w_k) e^{-i \Delta \o k \Delta t n} \Delta\o $

where $\Delta w =W/N$ so that $w_k= \Delta w \ \ k$ with $k=0,1,2,..., N-1$ . We discretized the time by $t_n= \Delta t \ \ n$ with $n=0,1,2,...,N-1$. Next we make the basic assumption that
$ W \Delta t = 2 \pi $ so we end up with
$I = \Delta\o \sum_{k=0}^{N-1} F(w_k) e^{- 2 \pi i \frac{n k}{N} } $
which is the basic definition of the Fast Fourier Transform. The problem was when I used it for a square function $F(\o)=\frac{1}{i\o}\left( e^{i\o T_0} -1 \right) $ This method gives an offset value. Then I modified the integral as

$I= \Delta\o \left( \sum_{k=1}^{N-1} F(w_k) e^{- 2 \pi i \frac{n k}{N} } + \frac{1}{2}(F(w_0)+F(w_N)) \right) $

Which is the trapezoidal rule instead of the Riemman integral, and gave a better result.

Best regards.

E. Gutierrez-Reyes


The following two articles may be of use. They don't let you do the transform at any old x values. But it does allow transformation from m equally spaced points in the w domain to m equally spaced points in the x domain. The Bailey and Swarztrauber article also uses a gaussian function like yours as an example. Sorry I can't be more specific but I'm learning all this stuff myself.

Bailey, D., and P. Swarztrauber. 1994. ‘A Fast Method for the Numerical Evaluation of Continuous Fourier and Laplace Transforms’. SIAM Journal on Scientific Computing 15 (5): 1105–10. doi:10.1137/0915067.

Inverarity, G. 2002. ‘Fast Computation of Multidimensional Fourier Integrals’. SIAM Journal on Scientific Computing 24 (2): 645–51. doi:10.1137/S106482750138647X.