I have some vibration data (acceleration) on which I need to perform an FFT, integrate it and again do an FFT.

I read that for the nature of the data that I have, the input to the FFT must be first windowed with a Hann window in order to avoid spectral leakage in the frequency domain representation after I perform the FFT. I further read that the amplitude of the FFT output vector must be corrected, because of the window function's 'window gain factor'.

The said window gain factor for the Hann window is about 0.5 and that means I must multiply the real part of each entry in the output array with 2 to effect this correction. My expectation was - If I DO NOT perform the window gain correction, the amplitudes on the Y axis of my FFTs will be about half the magnitude as that of the rectangular window, and therefore the correction is called for.

However, when I use 3 different window functions - Rectangular, Hanning and Flat-Top - WITHOUT performing any corrections for the gain factor in any case, I still get the similar aplitudes on the Y axis of my FFT. (Refer pictures below - in each case the first graph is the FFT result of acceleration and the second graph is for speed).

  • Rectangular Window:

enter image description here

  • Hann Window:

enter image description here

  • Flat-Top Window:

enter image description here

Why does this happen?

If I do perform the window gain correction, for example, in the case where I use the Hann window, then the amplitudes must be roughly double as compared to when I use a Rectangular window. How can the amplitudes on the FFT results be so wildly different if I use different window functions and do the correction correctly?

Should I ultimately do the correction for the window gain or not?

  • $\begingroup$ Hard to tell without seeing the details of what exactly you are doing: How are the windows applied (overlap, PSD, single FFT) and how you scale and calibrate the data to get real physical units. $\endgroup$
    – Hilmar
    Oct 6, 2022 at 14:14
  • $\begingroup$ Can you share your code? $\endgroup$
    – Jdip
    Oct 6, 2022 at 14:21
  • $\begingroup$ The amount of Gain lost through the window will vary on based on where the frequency lies between 2 FFT bins. If the sinusoid is exactly on a FFT bin then the coherent loss is equal to the number from the Harris paper. Further loss will occur if the frequency falls between 2 FFT bins - the maximum loss will occur when the frequency is equidistant to 2 adjacent FFT bins. $\endgroup$
    – David
    Oct 7, 2022 at 19:30

1 Answer 1


Consider the DFT of a constant function (DC). Let's say that $x[n]=1 \ \forall n$. You'll see that the result, at DC or $X[0]$, is the sum of the samples or $X[0]=N$.

Then window that constant function with a window $w[n]\le 1$. The the DFT at DC is reduced. That is the gain of the window.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.