Matlab frequency response I'm trying to make a frequency response of that function:



in matlab a made this:

d=[1 -0.494 0.6404];
p=[1 1.58567330897 0.96];
[h,w] = freqz(p,d,40000);
z = abs(h);
plot(w/pi,z);


d and p i calculated.
The plot gives me this:


but in book has that answer:
 

as you can see the peak of magnitude is 2 and not about 6.5. '-'
What am I doing wrong?
H2 has an abs 1 because it is a all pass filter.
Your answer is correct. Please note that your graph is in the range $0$ to $1$ while the graph in the text is in the output range of $-\pi$ to $+\pi$

There is some output scaling issue. But since you are getting the same curve, you are just messing some constants is all.

please try $\text{plot}(w,z)$