# Why doesn't my expression for the fourier transform of a function match its numerical fourier transform?

I am seeing a frustrating discrepancy between my evaluation of $$F(\omega) = \frac{1}{a + iw}$$, and the fast fourier transform of $$f(t) = e^{-at}u(t)$$ (where $$u(t)$$ is the step function from 0 to 1) of which it is supposed to correspond. The discrepancy is characterized by a substantial difference in the higher-frequency bins that causes an awful ringing effect on the inverse transform of $$F(\omega)$$. Let me tell you how I arrived at each, and maybe you can help identify where I have gone wrong.

# Computing $$f(t) = e^{-at}$$

I made an array of numbers in my computer that represented $$f(t) = e^{-at}$$ evaluated at $$1024$$ points, starting at $$at=0$$ and progressing upwards in steps of $$at_{i+i}-at_i = 0.01$$. Since the FFT actually expects a cyclic function, I also added in several $$e^{-a(t+T_j)}$$ for $$aT_j = 1.024j$$, which represented the decaying tails of the exponential functions which started before $$t=0$$. Since I could only iterate so many times this was not exact, but by the time I stopped iterating I assure you the size of the additional tails were insignificant.

# Computing $$F(\omega) = \frac{1}{a+i\omega}$$

I calculated the appropriate values of $$\omega$$ that would correspond to the bins of an FFT of the samles of $$f$$, and plugged them in to $$F(\omega)$$ to sample that function. I don't think I have to do anything other that that.

# The Results

Having these two arrays, I subtracted and plotted them. Here is what I get:

Taking the inverse transform, I get,

Clearly, I have done something wrong... but what? I know that some part of the problem must lie with $$F$$, because irrespective of what the appropriate function would be for a cyclic one-sided exponential decay, it definitely should not have that much ringing. If I interpolated between the time bins I would expect to see ringing due to the band limitation, but if I evaluate a function in every frequency bin and then inverse FFT it, there should not be any band limitations!

• The Fourier Transform and the Discrete Fourier Transform are two different things.
– user65203
Apr 23 '20 at 18:36
• @YvesDaoust How can I turn the FT of a function into its DFT? I thought I could simply sample it, but perhaps that is not right. Apr 23 '20 at 18:37
• @YvesDaoust In fact, I should add that according to [1], "the DFT of the $N$ samples comprising one period equals $N$ times the Fourier series coefficients." [1]ccrma.stanford.edu/~jos/mdft/Relation_DFT_Fourier_Series.html Apr 23 '20 at 18:46
• @YvesDaoust Is not the Fourier series of a cyclic function merely the coefficients of the delta functions that make up that cyclic function's Fourier transform? Apr 23 '20 at 18:53
• If you wish to use the DFT to approximate the Fourier transform you need to look at windowing & zero padding. These are DSP tricks using in spectrum analysers. Apr 23 '20 at 19:21

It turns out that I actually do have to do something to $$F(\omega)$$ to prepare it for the FFT: I need to compute its cyclic summation. The ideal path goes from $$F(\omega)$$ to $$f(t)$$ and then to the sampled $$f(t_i)$$, and in order to match that I need to take the equivalent path from $$F(\omega)$$ to $$\sum_{i=-\infty}^\infty F(\omega + id)$$ and then to the sampled $$f(t_i)$$.