title: Fourier Transform Using Numpy
body: <p>I'm trying to calculate the Fourier Transform of the following Gaussian:</p>
  
  <pre><code># sample spacing
  dx = 1.0 / 1000.0
  
  # Points
  x1 = -5
  x2 = 5
  
  x = np.arange(x1, x2, dx)
  
  def light_intensity():
      return 10*sp.stats.norm.pdf(x, 0, 1)+0.1*np.random.randn(x.size)
  
  fig, ax = plt.subplots()
  ax.plot(x,light_intensity())
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/AqhmC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AqhmC.png" alt="enter image description here"></a></p>
  
  <p>I create a new array in the spacial frequency domain (Fourier Transform of Gaussian is a Gaussian so these values should be similar). I plot and get this:</p>
  
  <pre><code>fig, ax = plt.subplots()
  
  xf = np.arange(x1,x2,dx)
  yf= np.fft.fftshift(light_intensity())
  ax.plot(xf,np.abs(yf))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/0icAH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0icAH.png" alt="enter image description here"></a></p>
  
  <p>Why is it splitting into two peaks?</p>