title: Frequency axis in a Numpy fft
body: <p>I have a 32x32 pixels image that I would like to compute the 1D power spectrum  (averaged along the y axis of the image). Here's what I do.</p>
  
  <pre><code>import numpy as np
  
  size_patch=32 
  
  # Take the fourier transform of the image.
  F1_obs = np.fft.fft2(image_obs)
  
  # Now shift the quadrants around so that low spatial frequencies are in
  # the center of the 2D fourier transformed image.
  F2_obs = np.fft.fftshift(F1_obs)
  
  # Calculate a 2D power spectrum
  psd2D_obs=np.abs(F2_obs)**2
  
  freq = np.fft.fftfreq(size_patch, d=1.)
  
  #Compute the 1D power spectrum (averaged along y axis)
  psd1D_obs[i] = np.average(psd2D_obs,axis = 0)[size_patch/2:] # we keep the end values of the array : the fft is symmetric
  </code></pre>
  
  <p>I have some trouble grasping what is precisely plotted as an x-axis in the power spectrum. Is it the wavenumber or the spatial frequency? What is the convention adopted here? Is the natural unit cycles/pixel? The doc for <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.fftfreq.html" rel="nofollow">numpy.fft.fftfreq</a> is a bit too vague to me. 
  This might be a very simple question but I didn't find any clear answer anywhere. Could you please enlighten me?</p>