# How to evaluate an integral using FFT when the integrand is sensitive to discretization points?

I am looking to find the following function using a FFT method:

$$g(x)=\frac{1}{2\pi} \int_{-m\pi}^{m\pi} \psi(u) \mathrm{e}^{iux}du$$

I start by discretizing $x \in [a,b]$ for $N$ equally spaced points by setting $x_k = a + k dx$ where $dx = \frac{b-a}{N}$. Then I approximate the integral using the rectangle rule which gives

$$g(x_k)=\frac{du}{2\pi} \sum_{n=0}^{N-1}\psi(u_n) \mathrm{e}^{i(-m\pi+ndu)(a+kdx)}$$

where $u_n=-m\pi + ndu$ and $du = \frac{2m\pi}{N}$. I can then rewrite the terms to give

$$g(x_k)=\frac{du}{2\pi} \mathrm{e}^{-im\pi x_k} \sum_{n=0}^{N-1} \mathrm{e}^{andu} \psi(u_n) \mathrm{e}^{i2\pi m nk dx/N}$$

Now, if I take $m = 1/dx$ then I have no problem finding $g(x)$. However, I am looking for a way to evaluate the integral for different values of $m$. If anyone could offer any thoughts I'd be very grateful.

• there is not so much to say in general. what is your true problem ? – reuns Jul 6 '16 at 1:29
• I am very new to the FFT and to me it seems that one has to take $m=1/dx$ in order for the right most exponential term to resemble the discrete Fourier transform in order to apply the FFT. I'm sure I'm just missing something though. – Bob Cobb Jul 6 '16 at 1:39
• you shouldn't write $du = \frac{2 m \pi}{N}$, and by definition of the Riemann integral $\int_a^b f(u) du= \lim_{N \to \infty} S_N$ where $S_N = \sum_{n=0}^{N-1} f(a+n\frac{b-a}{N})\frac{b-a}{N}$ so with $f(u) = e^{i x u} \psi(u)$ you get $S_N = \sum_{n=0}^{N-1} f(-m\pi+n\frac{2m\pi}{N})\frac{2m\pi}{N}$ $= \frac{2m\pi}{N}\sum_{n=0}^{N-1} \psi(-m\pi+n\frac{2m\pi}{N})e^{ix(-m\pi+n\frac{2m\pi}{N})} = 2m\pi e^{-ixm\pi} FFT[\psi_{N,m}(n)](-xm)$ with $\psi_{N,m}(n) = \psi(-m\pi+n\frac{2m\pi}{N})$ – reuns Jul 6 '16 at 2:17