Maximum phase with the same magnitude response I'm trying to solve an exercise in a general way and I can't find if my answer is correct.

Given this frequency response:

$$H(z) = 4 + 2\sqrt2 z^{-1} + z^{-2}$$

I need to find a frequency response that has maximum-phase response $H_{1}(z)$ such that $\lvert H(z)\rvert = \lvert H_{1}(z)\rvert$.

First of all, I write:

$$H(z) = \frac{4z^2+2\sqrt2 z + 1}{z^2}$$

So I see that I have zeros in:

\begin{align}
z_{01} &amp;= \frac{\sqrt2}{4}+j\frac{\sqrt2}{4}\\
z_{02} &amp;= \frac{\sqrt2}{4}-j\frac{\sqrt2}{4}
\end{align}

And poles in:

$$z_x = 0 \text{ (double)}$$

Now, I know that for a maximum phase system I need that all the poles and zeros have to be outside the unit circle, but from Oppenheim-Schafer I also know that I have to add a scalar factor for the minimum-phase case, so I suppose I also have to add that scalar factor now.

So I say that this:
$$H_1(z) = k \left(z- \frac{1}{z_{01}}\right) \left(z- \frac{1}{z_{02}}\right)$$
(I used that I have both poles in $z=\infty$, is that right?)
has to be the one that makes $\lvert H(z)\rvert = \lvert H_{1}(z)\rvert$.

But I can't find the value of $k$ (scalar factor), because when I write $z=e^{j\omega}$ and use the magnitude definition (magnitude = square root of the squared real part plus the squared imaginary part) I find that $k=1$ and $k=-1$.
Note that the zeros of the given transfer function have a negative real part:

$$z_{01}=\frac{1}{2\sqrt{2}}(-1 + j),\quad z_{02}=z_{01}^*\tag{1}$$

With $(1)$ you can write the transfer function as

$$H(z)=4(1-z_{01}z^{-1})(1-z_{01}^*z^{-1})\tag{2}$$

Reflecting a zero across the unit circle means replacing it by its conjugated inverse, i.e. $z_{01}\rightarrow 1/z_{01}^*$, from which you get

$$H_{max}(z)=k\left(z-\frac{1}{z_{01}}\right)\left(z-\frac{1}{z_{01}^*}\right)=\frac{k}{|z_{01}|^2}(1-z_{01}z)(1-z_{01}^*z)\tag{3}$$

The constant $k$ can be determined by evaluating $(2)$ and $(3)$ at a point on the unit circle $|z|=1$. If you choose $z=1$ you get

$$H(1)=4(1-z_{01})(1-z_{01}^*)\tag{4}$$

and

$$H_{max}(1)=\frac{k}{|z_{01}|^2}(1-z_{01})(1-z_{01}^*)\tag{5}$$

Comparing $(4)$ and $(5)$ you get

$$\frac{k}{|z_{01}|^2}=4\tag{6}$$

and with $(3)$

$$H_{max}(z)=4(1-z_{01}z)(1-z_{01}^*z)\tag{7}$$

Comparing $(7)$ with $(2)$ you can see that

$$H_{max}(z)=H(z^{-1})=z^2+2\sqrt{2}z+4\tag{8}$$

In the time domain this corresponds to a time reversal. If $h[n]$ is the impulse response corresponding to $H(z)$, and $h_{max}[n]$ corresponds to $H_{max}(z)$, then the following holds:

$$h_{max}[n]=h[-n]\tag{9}$$