How to plot magnitude response using $\tt freqz$ in MATLAB if I have a transfer function without a denominator So I have the transfer function:

$$H[z] = 1 + \sqrt{2}z^{-1} + z^{-2} $$

And I have to evaluate $H(e^{j\omega})$ for $\omega= 0, \pi/4, \pi/4 \ldots$

I have done the calculations manually using Euler's formula, but now the assignment is asking me to compare these plots with the plots using freqz in MATLAB. I can't seem to find instructions on how I can do that with this type of transfer function.
You simply specify a = 1 (because the denominator equals $1$). So you get


b = [1,sqrt(2),1];
a = 1;
N = 512;
[H,w] = freqz(b,a,N);


You can compare this to the analytical solution:


H2 = 1 + sqrt(2)*exp(-1i*w) + exp(-1i*2*w);
max(abs(H2-H))    % 8.0825e-16