# Frequency Response with Delta Function?

I am trying to find frequency response and magnitude of the frequency response of the following system impulse response: $$h[n] = 2\delta [n] + 2\delta [n-1]$$

I understand, that through the DTFT: $$H(\omega ) = 2(1 + e^{-j\omega})$$

However, I am unsure how to find the magnitude of the frequency response. The solution is: $$|H(\omega )| = 4 \left| \cos \left(\frac{\omega }{2} \right) \right|$$

What steps are needed in order to convert the above frequency response to the magnitude of the frequency response?

• It may be useful to know that, for a complex number $h$, $|h|^2=hh^*$. – MBaz Sep 24 '16 at 18:06

When the formula possesses some symmetry, like here (the two coefficients are the same), you can more efficiently factor a term, so that you recover a known Euler formula for the sine or the cosine, in the shape of $e^{j\nu}+e^{-j\nu}$ or $e^{j\nu}-e^{-j\nu}$. Here, factoring by $e^{-j\omega/2}$ yields $2e^{-j\omega/2}(e^{j\omega/2}+e^{-j\omega/2})$, from which the result follows easily.
Hint: Expand $e^{j \omega}$ using Euler's formula. This will enable you to express $H(\omega) = R(\omega) + j I(\omega)$ where $R$ and $I$ are the real and imaginary parts and then the magnitude of the frequency response is just $\sqrt{ R(\omega)^2 + I(\omega)^2}$.