title: Dividing fourier transform by factor n
body: <p>I have a problem with the fast fourier transform in python. I would like to extract the low and high frequency power of a signal. I have seen the following example:</p>
  
  <pre><code>Y = np.fft.fft(signal)/n #Calculate FFT
  Y = Y[range(n/2)] #Return one side of the FFT
  lf = np.trapz(abs(Y[(frq&gt;=0.04) &amp; (frq&lt;=0.15)]))
  hf = np.trapz(abs(Y[(frq&gt;=0.16) &amp; (frq&lt;=0.5)])) #Do the same for 0.16-0.5Hz (HF)
  </code></pre>
  
  <p><code>signal</code> is just a an array of values (Let's say 10000 values).</p>
  
  <p>The problem here is that I don't see what <code>n</code> should be. Should <code>n</code> just be the length of <code>signal</code>?</p>