# Why would one use a Hann or Bartlett window?

Suppose we're designing a low-pass FIR filter, and I want to use one of these three windows: Bartlett, Hann or Hamming. From Oppenheim & Schafer's Discrete-Time Signal Processing, 2nd Ed, p. 471:}

All three of them provide the same transition band width: $$\Delta\omega=\frac{8\pi}{N}$$ where $N$ is the order of the filter and is assumed large enough.

However, the overshoot (let's call it $\delta$) is different for each window, an the following inequality holds:

$$\delta_{Hamming}<\delta_{Hann}<\delta_{Bartlett}$$

So if we use a Hamming window, we get the smallest overshoot and a transition band with width $\Delta\omega$. If we use one of the other two windows, the width of the transition band is the same, but the overshoot increases.

This leads me to think that there is no case in which one would use a Hann or a Bartlett window, as the Hamming one is better than them: it improves one aspect ($\delta$), stays the same in another ($\Delta\omega$).

The question is: why would someone choose a Hann or a Bartlett window if a Hamming one can always be used?

• Could you provide some clarification - do you have references for those equations? What do you mean by "overshoot" in this context? Apr 28 '17 at 12:54
• @MartinThompson I just added the reference. By overshoot I mean the peak of the frequency response due to the discontinuity of the ideal low-pass filter that one tries to approximate to. Apr 28 '17 at 13:03

In reviewing Fred Harris Figures of Merit for various windows (Table 1 in this link) the Hamming is compared to the Hanning (Hann) at various values of $$\alpha$$ and from that it is clear that the Hann would provide greater stopband rejection (The classic Hann is with $$\alpha =2$$ and from the table the side-lobe fall-off is -18 dB per octave). I provided the link as you can see many more considerations involved when choosing a window for various applications.

The result of this is apparent when comparing the kernels for a 51 sample Hann and Hamming window using Matlab/Octave. Note the higher first sidelobe level with Hann but significantly greater rejection overall:

Personally, I would not use either window for filter design. If any window, I would use the Kaiser window, or preferably firls. See FIR Filter Design: Window vs Parks McClellan and Least Squares for the related discussion.

I convolved a 26 sample Hann with a 26 Hamming to come up with an alternate 51 sample "Hann-Hamming" with the following result:

UPDATE: This Hann-Hamming does not (generally) out-perform a Kaiser window of similar main-lobe width:

I then tried what I call a "SuperKaiser" where I convolved two shorter length Kaiser windows to come up with an alternate 51 tap window with the following result. This was done by convolving Kaiser(26,5.5) with Kaiser(26,5.5) such that SuperKaiser(51,5.5)= conv(kaiser(26,5.5),kaiser(26,5.5). At first glance it appears to generally outperform the kaiser(51,12), matching the main lobe width and providing superior stopband rejection over most of the stopband. An integration of total stopband noise under the assumption of AWGN is of interest to see if this new window is superior under that condition (does the relative area under the first two sidelobes where SuperKaiser is inferior completely offset all the remaining stopband improvement?). If I have time I will add that assessment. Interesting! As @A Concerned Citizen astutely pointed out, as we keep convolving we should approach a Gaussian window.

• Hi Dan, thanks for your answer. That table has something that looks weird to me. I believed that the Hann window was defined univocally. In that paper, it appears that it has a variable parameter $\alpha$. Where does it come from? If we vary $\alpha$, is the window still a Hann function strictly speaking? Apr 28 '17 at 13:29
• @Tendero fred harris explains in detail on page 181 in the link section C for the $Cos^{\alpha}(X)$ windows, and there he says the Hann window specifically is with $\alpha =2$. I made that clearer in the answer, thanks! Apr 28 '17 at 13:38
• @Tendero So bottom line, what I think was missing from your table of reference but an important consideration is the side-lobe fall-off. This is of particular concern with multisampling applications since there can be many alias bands that fold-in, so a rapid roll-off helps minimize noise growth. Also in the interest of minimizing overall noise in the presence of AWGN (only) a faster roll-off at the expense of a higher first lobe would usually win. Apr 28 '17 at 13:46
• That intriguing comparison made me repeat it, but I couldn't get the same results. Then I took a closer look and it looks like you didn't closely match Kaiser's parameter. Using the As design, I got very close with As=108.5 for N=32 and N[hann]=17, N[ham]=16, but the sidelobes of the convolved window are unequal and they wobble above Kaiser's. I've seen people "mingling" two windows, or more, but either as arithmetic or geometric mean, never convolved. Still, the results are impressive. Apr 29 '17 at 5:55
• @aconcernedcitizen Yes something was not right about that and indeed was me using too quickly 30 and 31 to create an "equivalent" 51 tap window: What I was doing was comparing a 60 sample window to a 51 tap Kaiser- Not fair! I updated the post by convolving 26 and 26 which results in 51 samples which would then be a fair comparison, and of course Kaiser appears to win for overall performance (although I did not go through an integrate total stopband noise). Convolving seems a natural choice as it results in multiplying the frequency responses, equivalent to cascading two windows. Apr 29 '17 at 13:08

If there is an attacker with knowledge of the window and trying to focus noise spectrum so as to minimize your S/N, then a minimax solution, such as a Hamming window, might be the optimal counter.

Most noise tends not to be so purposefully malicious, rendering a minimax solution less optimal, at least statistically speaking.