# Why square-root of Hanning Window

I just studied an implementation (Matlab) of a windowed FFT and saw the following line of code:

w = sqrt(hann(fft_length, 'periodic'))


and later:

spectogram(:, column) = fft(ringbuffer.*w, fft_length) %why .*w ?


The ringbuffer obviously contains the current frame of the signal and the overlap so its's obvious to me that this needs to be multiplied with the Hanning Window but why is the square-root being taken first?

• i don't know anything about the specific functions, but it has the general smell of a power-vs-amplitude question, with signal power varying with the square of the signal amplitude. Apr 19, 2018 at 17:14

The purists will tell you it should be called a Hann window, or VonHann, but not Hanning.

From a math perspective, the Hann window is also equivalent to a sine squared window at half the frequency, so by taking the square root you are getting a sine window.

Why use a window at all? The seminal paper on the topic is:

harris, fred. (Jan 1978). "On the use of Windows for Harmonic Analysis with the Discrete Fourier Transform"

A link to the paper can be found in reference  of the Wikipedia article on windows.

Hope this helps.

Ced

• Thanks, that actually helped a lot. I was unaware of the fact that there are more windows with a name that starts with Ha..something.. Now that you pointed out that fact I found lots of research on the topic
– Alon
Apr 19, 2018 at 12:18
• It's either Hamming (MM) or Hann (NN). Hanning mixes the two, making it ambiguous which of the two was meant. Apr 19, 2018 at 14:33
• @MSalters, I was trying to point that out to the OP without being overbearing. The use of the term "Hanning" is quite prevalent for it being incorrect, so the OP can certainly be forgiven. The Hann window is my preference for spectrogram usage. For numerical analysis of DFT results, I believe that no window should be used at all. Applying a window complicates the underlying math. See my blog (dsprelated.com/blogs-1/nf/Cedron_Dawg.php) for novel exact equations concerning pure tones in a DFT. P.S. fred harris likes his name in lower case. Apr 19, 2018 at 15:48