title: Matlab FFT for gaussian function
body: <p>I am trying to obtain <code>gaussian curve</code> by using matlab's fft. The problem is that in one case my attemp to reduce noise by dividing <code>F=dt.*F./exp(-1i.*nu.*T/2)</code> is not working (img 1) and in the second case if I am trying to take absolute value of fft result's I dont have decent scale in graph (img 2).</p>
  
  <pre><code>N=512;
  T=10;
  dt=T/(N-1);
  t=linspace(-5,5,N);
  f=exp(-t.^2);
  F=fft(f);
  
  F1=F(1:N/2+1);
  F2=F(N/2+1:N);
  F=[F2,F1];
  
  dnu=(N-1)/(N*T);
  nuNyq=1/(2*dt);
  nu=-nuNyq+dnu*(0:N);
  F=dt.*F;
  %F=dt.*F./exp(-1i.*nu.*T/2);
  
  
  y=linspace(-5,5,N);
  F2=pi.^(1/2).*exp(-y.^2/4);
  
  hold on
  plot(y,F2); 
  %plot(nu,real(F),'r');
  plot(nu,abs(F),'r');
  legend('analiticFT','FFT')
  xlim([-5 5])
  hold off
  </code></pre>
  
  <p>img 1
  <img src="https://i.stack.imgur.com/MvLrj.png" alt="img. 1"></p>
  
  <p>img2
  <img src="https://i.stack.imgur.com/WSFr9.png" alt="img. 2"></p>