# When is discrete Fourier transform a good approximation to the continuous one?

I am looking for help in understanding the use of discrete Fourier transform as an approximation to continuous Fourier transforms.

As an exercise, I considered a Gaussian $$f(x) = \exp\left(-2x^2\right),$$ the (continuous) Fourier transform of which is $$F(k)=\frac{1}{2}\exp\left(\frac{-k^2}{8}\right).$$ I sampled the Gaussian at 10,000 discrete points equally spaced between 0 and 100 and took the discrete Fourier transform of the resulting set of numbers. The question I wanted to ask was how well the discrete Fourier transform compare with the continuous one. Results of this calculation are shown in this figure (thick curve is the analytical, continuous, result; thin one is the numerical, discrete, result): Evidently, the discrete and Fourier transform are quite different from each other, especially at small $k$. Could somebody help understand why?

Thanks!

Update: It was pointed out that I wasn’t really comparing apples to apples in the plots above. I had assumed different scalings the continuous and discrete cases. I corrected that, but the problem won’t go away. Here is the updated version of the Gaussian calculation above: To check this on a bandwidth-limited function, I also tried working with the sinc function: $$f(x) = \frac{\sin(x)}{x}.$$ And I have the same problem: I seem to be getting the exact same factor of difference in both cases, which suggests that I have missed some scaling factor. But I just cannot find one!

Thanks!

I haven't done the algebra, but I think you have the formula wrong. http://mathworld.wolfram.com/FourierTransformGaussian.html. There's some factors of $\pi$ missing from your answer. Which scaling of the Fourier Transform did you use?
• @Girish Kulkami: In your updated plots, you're off by a factor of 2. You must have originally been missing a factor of $2/\pi$ or something like that. – Victor Liu Sep 24 '13 at 8:47