# How to compute the main lobe width of generalized Hamming windows (i.e. Hann, Hamming, etc.)?

Is there a way to compute the main lobe width of windows of the generalized Hamming window family (i.e. Hann, Hamming, etc.)? By main lobe I mean the first zeros left and right of the center of the Fourier transform of the windows.

I could not find any derivation in any of the standard textbooks. In Oppenheim/Schafer 'Discrete-time signal processing' (2nd Ed., p. 471), only the 'approximate width' of the main lobe is provided without proof.

Just to give you some background: Windows of the generalized Hamming window family are given by the following equation: $w_H(n) = w_R(n) \cdot (\alpha + 2\beta \cdot cos(\Omega_M n))$ (see e.g. here), where $w_R(n)$ is the rectangular window of length $M$, and $\Omega_M = \frac{2\pi}{M}$.

The Fourier transform (FT) of these windows is given by: $W_H(\omega) = \alpha W_R(\omega) + \beta W_R(\omega - \Omega_M) + \beta W_R(\omega + \Omega_M)$. In this equation $W_R(\omega)$ denotes the Fourier transform of the rectangular window.

$W_R(\omega)$ is simply a sinc-function, so $W_H(\omega)$ consists of the sum of three sinc functions with centers at different positions of the frequency axis.

• Numerically find the roots of $W_H(\omega)$? Is that exact enough for you, or are you looking for a closed analytic form? – Jason R Jul 22 '14 at 14:50
• I was hoping to find a closed form. – koffer Jul 22 '14 at 14:51
• @Jason, but do you have any suggestions to find the roots without using a generic root finder? – koffer Jul 22 '14 at 15:06
• The first zero occurs when $W_H(\omega)$ first reaches zero (obviously), so we're just solving for $\omega$ when $\alpha W_R(\omega) = -\beta(W_R(\omega-\Omega_M)+W_R(\omega+\Omega_M))$. But looking at the first zero without worrying about the sidelobe height appears to be missing the point of windowing: you're not consistently trading mainlobe width for sidelobe height. – dpwe Jul 22 '14 at 15:08
• This might be a good question for math.SE. If you provide the function (i.e. the sum of $\text{sinc}$ functions, they might be able to suggest a closed form solution for the roots. – Jason R Jul 22 '14 at 15:08

(This used to be a partial answer, but I have edited it to include the requested result at the bottom.)

First of all, you can view a Hamming family window as the sum of a Hann window and a rectangular window: If $W_N$ is the fourier transform of a Hann window, then $W_H(\omega)=(\alpha-2\beta)W_R(\omega)+4\beta W_N(\omega)$. If, for simplicity, we assume unit amplitude ($\beta=\frac{1-\alpha}{2}$), then $x:=4\beta=2-2\alpha$ determines the weighting of the Hann window against the rectangular window ($\alpha-2\beta=1-x$ in that case). In the general case, you just need to factor out the coefficient $\alpha+2\beta$ first and let $x:=\frac{4\beta}{\alpha+2\beta}$.

For example, here is a plot of $W_H$ (green) and its two components for $x=0.5$ (assuming $M=2$, I guess, so that $W_R(\omega)=\frac{\sin \omega}{\omega}$): Obviously, giving the Hann window more weight by increasing $x$ also increases the main lobe width. However, plotting this relationship reveals an interesting effect: Since $W_R(2\Omega_M)=W_N(2\Omega_M)=0$, as soon as the Hann window component completely cancels out the first side lobe of the rectangular window component, the main lobe width stays constant at $4\Omega_M$. By calculating the derivatives at this point, it is easy to find out that this is the case for $x\geq\frac{6}{7}$ (equivalently, $\alpha\leq\frac{4}{7}$ in the unit amplitude case, or $3\alpha\leq 8\beta$ in the general case).

Unfortunately, from the plot, I haven't successfully guessed anything about the remaining $\frac{6}{7}$. ;-) Hopefully someone else will figure this out, if it is possible at all.

Edit: Don't know why I didn't go for the simplest route first. Maxima (open-source CAS) gives $\Omega_M \sqrt{2\frac{x-2}{x-1}}$ for the remaining part. So, in general, the main lobe width is:

$\begin{cases} 2\Omega_M \sqrt{\frac{\alpha}{\alpha-2\beta}} & \text{if } 8\beta<3\alpha\\ 4\Omega_M & \text{otherwise} \end{cases}$

• Hi @Sebastian, thanks for you answer. How did you compute the mainlobe width for your second plot? If you used an analytical function, surely that would be the answer to my question. And how did you obtain the last result with Maxima? – koffer Jul 30 '14 at 14:15
• The second plot is just a numeric computation using Maxima's "find_zero" function. Then I tried the "solve" function instead and surprisingly got a result. If you plot $f(x)=\pi \sqrt{2\frac{x-2}{x-1}}$ between $0$ and $\frac{6}{7}$, you get the same picture. – Sebastian Reichelt Jul 31 '14 at 16:16