# Proving for windowing function

Prove that $$1+2\cos(\omega)$$ is the same as $$\frac{\sin(\frac{3\omega}{2})}{\sin(\frac{\omega}{2})}$$

Knowing that $$p[n]=\sum_{k=-1}^1 {\delta[n-k]}=\delta[n-1]+\delta[n]+\delta[n+1]$$

Doing the FT yields \begin{align} P(e^{j\omega}) &=\sum_{k=-\infty}^\infty p[n]e^{-j\omega n} \\ &=e^{-j\omega}+1+e^{j\omega} \\&=1+2\cos(\omega) \end{align}

But, how does this fit into the general formula of $$\frac{\sin(\omega(M+\frac{1}{2}))}{sin(\frac{\omega}{2})}$$ where, in this case my $$M=1$$?

Thank you.

I have come across my ways.

\begin{align} P(e^{j\omega})&=1+2\cos(\omega) \\ &=\sum_{k=-\infty}^\infty \sum_{k=-1}^1 \delta[n-k]e^{-j\omega n} \end{align}

Knowing that non-zero only when $$n=k$$,

$$P(e^{j\omega})=\sum_{k=-1}^1 e^{-j\omega n}$$

Let $$M=n+1$$,

\require{cancel} \begin{align} P(e^{j\omega}) &=\sum_{k=0}^2 e^{-j\omega (M-1)} \\ &=e^{-j\omega (-1)} \sum_{k=0}^2 e^{-j\omega M} \\ &= e^{j\omega} \left(\frac {1-e^{-j\omega 3}} {1-e^{-j\omega}}\right ) \\&=\cancel{e^{j\omega}} \left( \frac {e^{j\omega 3/2}} {e^{-j \omega 3/2}} \right) \left( \frac {e^{j\omega 3/2} - e^{-j\omega 3/2}} {\cancel{e^{j\omega}} e^{j\omega 1/2} - e^{-j\omega 1/2} } \right) \\&= \frac{\sin(\frac{3\omega}{2})}{\sin(\frac{\omega}{2})} \end{align}

• Welcome! It is great to see you could answer your question and share the solution with us. – Royi Jan 4 '20 at 10:31

The real-valued amplitude function of a rectangular window of length $$N$$ is

$$A(\omega)=\frac{\sin\left(\frac{N\omega}{2}\right)}{\sin\left(\frac{\omega}{2}\right)}\tag{1}$$

So what you get is exactly what you would expect according to $$(1)$$, because in your case you have $$N=3$$. The constant $$M$$ in your formula is related to $$N$$ by $$N=2M+1$$ or $$M=(N-1)/2$$.

If you used that rectangular sequence as an impulse of a causal filter, then $$M$$ would be the group delay caused by the filter.

And, of course, for proving the given equation you don't need any DSP knowledge, just multiply both sides with $$\sin(\omega/2)$$ and use the trigonometric identity $$2\sin(x)\cos(y)=\sin(x+y)+\sin(x-y)$$ with $$x=\omega/2$$ and $$y=\omega$$.