# DFT and continuous Fourier transform gives different result? [closed]

I am working on the inverse Fourier transform of $$\frac{\sqrt{|k|}}{i(|k|-\omega)-\Gamma}$$ with $$\omega=100, \Gamma=1$$. For continuous Fourier transform, I get the following result:

fx = InverseFourierTransform[Sqrt[Abs[k]]/(I (Abs[k] - 100) - 1), k,  x]
Plot[Abs[fx], {x, -200, 200}, PlotRange -> {{-200, 200}, {0, 1}}]


However, when I try the DFT, I get a completely different result:

f[k_] := Sqrt[Abs[k]]/(I (Abs[k] - 100) - 1);
sampling = Array[f, 10000, {0, 200}];
ListLinePlot[Abs[InverseFourier[sampling]], PlotRange -> {0, 1}, DataRange -> {0, 40 Pi}]


I don't know what's wrong with my code, sampling, wrong understanding of DFT? What are those peaks in continuous FT? Thanks for any help.

• With DFT, the highest frequencies are in the middle. Notice also that Fourier and InverseFourier apply Fourier analysis on the unit circle while FourierTransform and InverseFourierTransform perform Fourier analysis for the real line. I suggest to read the manual. – Henrik Schumacher Feb 12 at 19:51
• @HenrikSchumacher, As far as I know, a real function's Fourier transform is generally a complex function, and now I need to get the original function from its Fourier transform. BTW, this function is from quantum mechanics, so it may not be a real function. – Jieyu You Feb 12 at 20:03
• It is not about real-valued or complex-valued functions: It is about the domains of functions. Fourier applies Fourier transform for piecewise-linear functions $f \colon S^1 \to \mathbb{C}$ on the unit circle $S^1$ while FourierTransform acts on functions on functions $f \colon \mathbb{R} \to \mathbb{C}$ on the real line $\mathbb{R}$. – Henrik Schumacher Feb 12 at 20:08

The problem is that InverseFourierTransform gives the result in terms of Fresnel integrals,

fx = InverseFourierTransform[Sqrt[Abs[k]]/(I (Abs[k] - 100) - 1), k, x]


(1/Sqrt[2 [Pi]])(-((I Sqrt[2 [Pi]])/Sqrt[ Abs[x]]) + (2 + 200 I) Sqrt[-(100/10001) - I/ 10001] [Pi] (-Cosh[(1 + 100 I) Abs[x]] + FresnelC[(Sqrt[20002/[Pi]] Sqrt[Abs[x]])/ Sqrt[-100 - I]] (Cosh[(1 + 100 I) Abs[x]] - I Sinh[(1 + 100 I) Abs[x]]) + FresnelS[(Sqrt[20002/[Pi]] Sqrt[Abs[x]])/ Sqrt[-100 - I]] (Cosh[(1 + 100 I) Abs[x]] + I Sinh[(1 + 100 I) Abs[x]])))

which is numerically very unstable to evaluate. A direct integration gives the result in terms of error functions,

Fx = 1/Sqrt[2π] Integrate[Sqrt[Abs[k]]/(I (Abs[k] - 100) - 1) E^(-I k x),
{k, -∞, ∞}, GenerateConditions -> False]


-(1/(Sqrt[20002] Sqrt[-I x] Sqrt[I x])) E^((-1 - 100 I) x) (I Sqrt[10001] E^((1 + 100 I) x) Sqrt[-I x] + I Sqrt[10001] E^((1 + 100 I) x) Sqrt[ I x] + (1 + 100 I) E^((2 + 200 I) x) Sqrt[(-100 - I) [Pi]] Sqrt[-I x] Sqrt[I x] - (1 + 100 I) E^((2 + 200 I) x) Sqrt[(-100 - I) [Pi]] Sqrt[-I x] Sqrt[I x] Erf[(Sqrt[10001] Sqrt[-I x])/Sqrt[-100 - I]] + Sqrt[(1000100 - 10001 I) [Pi]] Sqrt[-I x] Sqrt[I x] Erfc[Sqrt[-100 + I] Sqrt[I x]])

which is much easier to evaluate.

The results are the same apart from numerical artefacts for $$\lvert x \rvert \gtrsim 16$$:

Plot[{Abs[fx], Abs[Fx]}, {x, -20, 20},
PlotRange -> {0, 1}, PlotLegends -> {InverseFunction, Integrate}]


The two curves evaluate to the same result if you use enough numerical precision.

It seems that the option GenerateConditions -> False is really the key to switching from Fresnel integrals to error functions, even though no conditions are generated without this option. Although the manual for InverseFourierTransform states that "Assumptions and other options to Integrate can also be given in InverseFourierTransform", the command InverseFourierTransform[Sqrt[Abs[k]]/(I (Abs[k] - 100) - 1), k, x, GenerateConditions -> False] still generates a result in terms of Fresnel integrals.

• That answers my question, thanks a lot! – Jieyu You Feb 12 at 20:36