# what is the fast fourier transform of complex guassian?

It is widely known that Fourier transform of complex Guassian function $$\mathcal \ F(x)=e^{-j x^2/a}$$ is $$\mathcal \ F(f)= A e^{jπ^2f^2a}$$

It is clear that both the function and its Fourier transform have constant absolute value. That is $$\mathcal \ |F(x)|=1 \ \ \ \ \ \ \ for \ all \ \ x$$

$$\mathcal \ |F(f)|=A \ \ \ \ \ \ \ for \ all \ \ f$$

Now the problem is when I calculate the Fourier transform of $F(x)$ in Matlab using matlab command fft and I plot absolute value of $|F(f)|\ vs \ f$ using function $abs(F(f))$. Instead of getting a constant value, I get a function which decays on either side (picture attached).

Is there something wrong in my logic?

Absolute value of Fourier transform

%%% Matlab code %%% clc
clear all
L=2e-2;
a=1e-6;
npix=1024;
Fs=(npix-1)/(L);
x=L*(-0.5:1/(npix-1):0.5);
fx=Fs*(-0.5:1/(npix-1):0.5);
I=exp(-1j*(x.^2)/(a));
FI=fftshift(fft(I)/npix);
cFI=exp(-1j*(pi^2)*(fx.^2)*a);
plot(x,imag(I))
figure
plot(x,abs(I))
figure
plot(fx,imag(FI),'m')
figure
plot(fx,abs(FI),'m')