%% Example 4.12
%
% I graph the z-transforms, evaluated at e^{i\omega }, of the low and high pass filters h_0 =\frac{1}{4}\left(\delta_{-1} +2\delta_0 +\delta {\text{ }}_1 \right) and h_1 =\frac{1}{4}\left(-\delta_{-1} +2\delta_0 -\delta {\text{ }}_1 \right)\ldotp
%

syms w
H0 = cos(w/2)^2; H1 = sin(w/2)^2;
fplot(H0,[-pi,pi])
hold on
fplot(H1,[-pi,pi],'--')
title('Graphs of H_0(e^{i\omega}) and H_1(e^{i\omega})')
xticks([-pi -pi/2 0 pi/2 pi])
xticklabels({'-1','-.5','0','.5','1'})
yticks([0:0.2:1])
xlabel('frequency \omega (multiples of \pi)')