title: FFT results Matlab VS Numpy (Python) : not the same results
body: <p>I have a Matlab script to compute the DFT of a signal and plot it:</p>
  <p>(data can be found <a href="https://drive.google.com/open?id=0B97qe9jXEgMZUVpoSU5ETHViak0" rel="nofollow noreferrer">here</a>)</p>
  <pre><code>clc; clear; close all;
  
  fid = fopen('s.txt');
  txt = textscan(fid,'%f'); 
  
  s = cell2mat(txt);
  
  nFFT = 100;
  fs = 24000;
  deltaF = fs/nFFT;
  FFFT = [0:nFFT/2-1]*deltaF;
  win = hann(length(s));
  
  sw = s.*win;
  FFT = fft(sw, nFFT)/length(s);
  FFT = [FFT(1); 2*FFT(2:nFFT/2)];
  absFFT = 20*log10(abs(FFT));
  
  plot(FFFT, absFFT)
  grid on
  </code></pre>
  <p>I am trying to translate it to Python and can't get the same result.</p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  from matplotlib import pyplot as plt
  
  x = np.genfromtxt(&quot;s.txt&quot;, delimiter='  ')
  
  nfft = 100
  fs = 24000
  deltaF = fs/nfft;
  ffft = [n * deltaF for n in range(nfft/2-1)]
  ffft = np.array(ffft)
  window = np.hanning(len(x))
  
  xw = np.multiply(x, window)
  fft = np.fft.fft(xw, nfft)/len(x)
  fft = fft[0]+ [2*fft[1:nfft/2]]
  fftabs = 20*np.log10(np.absolute(fft))
  
  plt.figure()
  plt.plot(ffft, np.transpose(fftabs))
  plt.grid()
  </code></pre>
  <p>The plots I get (Matlab on the left, Python on the right):</p>
  <p><a href="https://i.stack.imgur.com/pRiRG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pRiRG.jpg" alt="enter image description here" /></a></p>
  <p>What am I doing wrong?</p>