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

159 Views Asked by At

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:

Frequency Domain

Taking the inverse transform, I get,

Time Domain

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!

1

There are 1 best solutions below

0
On

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)$.

This chart makes the equivalencies clear:

https://en.wikipedia.org/wiki/Discrete_Fourier_transform#/media/File:From_Continuous_To_Discrete_Fourier_Transform.gif