title: Meaning of the function numpy.fft.fftfreq
body: <p>Some days ago I came across this answer about the usage of the <a href="https://stackoverflow.com/a/3695448/6441490">FFT</a></p>
  
  <p>In the answer there's a piece of code like this:</p>
  
  <pre><code>w = np.fft.fft(data)
  freqs = np.fft.fftfreq(len(w))
  </code></pre>
  
  <p>I read about the function <strong>fftfreq</strong> in the numpy documentation (<a href="https://docs.scipy.org/doc/numpy-1.12.0/reference/generated/numpy.fft.fftfreq.html" rel="noreferrer">here</a>) and i found that it returns an array with the following content:</p>
  
  <pre><code>f = [0, 1, ...,   n/2-1,     -n/2, ..., -1] / (d*n)   if n is even
  f = [0, 1, ..., (n-1)/2, -(n-1)/2, ..., -1] / (d*n)   if n is odd
  </code></pre>
  
  <p>In my case, the <strong>d</strong> var is equal to 1 and <strong>n</strong> is an even number.</p>
  
  <p>So my question is: what is exactly the aim of <strong>fftfreq</strong>?</p>
  
  <p>I was wondering if it was a sort of a triangular window function.</p>