title: Smoothing FFT graph in Python
body: <p>I would like to smooth my FFT graphs that are obtained at 200Hz (I capture 500 points at the moment) so that the representative peaks would be shown close to <a href="https://i.stack.imgur.com/FXqSV.png" rel="nofollow noreferrer">THIS</a>.</p>
  
  <p>This is my code:</p>
  
  <pre><code>N = 500
  T = 5/1000
  y1 = np.array(data_Ax)
  yf1 = scipy.fftpack.fft(y1)
  xf1 = np.linspace(0.0, 1.0/(2.0*T), N/2)
  yfft1 = 2.0/N * np.abs(yf1[:N//2])
  
  plt.figure(figsize=(20, 3), dpi= 100, facecolor='w', edgecolor='k')
  plt.plot(xf1, yfft1, 'g-', label ="FFT for Ax")
  plt.xlabel('Frequency [Hz]')
  plt.legend(loc=1)
  </code></pre>
  
  <p>For smoothing I tried to use this:</p>
  
  <pre><code>rft = np.fft.rfft(yfft1)
  y_smooth = np.fft.irfft(rft)
  </code></pre>
  
  <p>But it didn't have any effect.</p>
  
  <p>I'm well aware that 200Hz is a low sampling frequency and 500 measurements aren't much, but it is just to get the hang of the program. Here is the obtained graph:
  <a href="https://i.stack.imgur.com/6yoWE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6yoWE.png" alt="enter image description here"></a></p>
  
  <p>I would like to know:</p>
  
  <ol>
  <li>how to smooth the graph?</li>
  <li>how to remove the peaks at 0Hz (High pass filter)?</li>
  <li>From the theoretical point of view, is there a minimum number requirement of measurements for a representative  FFT graph?</li>
  </ol>
  
  <p>Thank you for any given help!</p>
  
  <p>L</p>