1
votes

I am using the following MATLAB code to perform a Fourier transformation of a normal density function:

N=100;
j=0:(N-1);
a=-5;
b=5;
dx = (b-a)/N;
x = a+j*dx;
dt = 2*pi/(N*dx);
f1 = -N/2*dt;
f2 = N/2*dt;
t= f1+ j*dt;
GX =  normpdf(x,0,1);
fft_GX = real(fft(GX))';

However, I do not get the expected bell shaped curve when I try to plot fft_GX. The Fourier transformation of a normal density has the form of e^(-t^2/2). Can someone please help as to what I am doing incorrect?

1
Please see my answer at stackoverflow.com/questions/45475351/… for an explanation and example on how to plot the FFT.jodag

1 Answers

1
votes

Trying using abs instead of real.

Another helpful function to recenter the frequency domain is fftshift. Otherwise you will see the plot from 0 to 2*pi I believe, instead of the more recognizable view from -pi to pi.

fft_GX = abs(fftshift((fft(GX))');
plot(fft_GX);

You may need to do some further normalization based on the number of samples you have, but it looks more like the expected bell curve than what you were seeing originally.