title: FFT - Peak to Peak, Peak, RMS
body: <p>I work with vibration, and I am trying to get the following information from a FFT amplitude:</p>
  
  <ul>
  <li>Peak to Peak</li>
  <li>Peak</li>
  <li>RMS</li>
  </ul>
  
  <p>I am performing an FFT on a simple sine wave function, considering a Hanning windowing.
  Note that the "full amplitude" from the sine wave function is 5, and running the code below the FFT gives me 2.5 amplitude result. So, in this case, I am getting the peak from FFT. What about peak to peak and RMS?</p>
  
  <p><strong>P.-S.</strong> - I am not interested in the RMS of a bandwidth frequency (i.e parsevall theorem). I am interested in the RMS from each peak, that is usually seen in vibration software.</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  
  f_s = 100.0 # Hz  sampling frequency
  f = 1.0 # Hz
  time = np.arange(0.0, 10.0, 1/f_s)
  x = 5 * np.sin(2*np.pi*f*time)
  N = len(time)
  T = 1/f_s
  
  # apply hann window and take the FFT
  win = np.hanning(len(x))
  FFT = np.fft.fft(win * x)   
  n = len(FFT)
  yf =  np.linspace(0.0,1.0/(2.0*T),N//2)
  
  plt.figure(1)
  plt.plot(yf,2.0/N * np.abs(FFT[0:N//2]))
  plt.grid()
  
  plt.figure(2)
  plt.plot(time,x)
  plt.xlabel('time')
  plt.ylabel('Amplitude')
  plt.grid()
  plt.show()
  </code></pre>