# How do I plot the square of the amplitude response?

I have calculated the transfer function of an FIR filter

$$y[n] = x[n] + α · x[n − R]$$ This is what I have $$H(z) = 1 + αz^{-R}$$

Now I should plot the square of the amplitude response. So I calculated the frequency response by inserting e^jωTs for z. I should choose α = 1/2 and R = 3. So I get

$$H(e^{jωTs}) = 1 + αe^{-RjωTs} = 1 + \frac{1}{2} e^{-3jωTs}$$

$$|H(e^{jωTs})|^{2} = (1 + αe^{-RjωTs})^{²} = 1 + \frac{1}{2} e^{-6jωTs}$$

I am also not sure here about the algebra of the square of the magnitude.

Now I should plot from 0 to ωs and I think I am missing Ts. I should probably just choose a value, right? How is the usual approach?

• You have (at least) one issue with your "squared amplitude" the first equality in the last line does not hold, one should multiply $H()$ by its conjugate – Laurent Duval Jun 27 '18 at 14:59
• I don’t know what Ts is but I don’t like it. Also, that isn’t how you square numbers. Once you change it to multiply by the complex conjugate, don’t forget to FOIL! – Dan Szabo Oct 23 '18 at 12:41

If the impulse response $$h[n]=\delta[n]+\alpha \delta[n-R]\hspace{1cm}=\{1,0,0,...\alpha\}$$ with the ellipsis being R presumably, the Fourier transform $$H(\omega)=e^{-j 0 \omega}+\alpha e^{-jR \omega}=1+\alpha e^{-jR \omega}\hspace{1 cm}\exists\hspace{1 cm}\mathbb{C}$$ where magnitude is defined as $$\sqrt{x^{2}+y^{2}}=|x+iy|$$
Since we want the square of the amplitude response $$=|H(\omega)|^2$$, we can square the real and imaginary parts of the transform$$\Re{\{H(\omega)\}}^{2}+\Im{\{H(\omega)\}}^{2}\hspace{.5cm}=\hspace{.5cm}(1+\alpha \cos(-R\omega))^{2}+\alpha \sin(-R\omega)^2\hspace{.5cm}\exists\mathbb{R}$$ Then plot from $$\omega=[0,\pi)$$