I am having trouble reconciling my derivation of the phase response of an N-th order all-pass filter with those I am finding in the literature, and I figured someone here could help me.
Real Version:
An $N$-th order real coefficient all-pass filter's transfer function is given by [1,2]:
$$ H_{A}(z) = z^{-N} \frac{A(z^{-1})}{A(z)}$$
where:
$$ A(z) = 1 + a_{1} z^{-1} + a_{2} z^{-2} + \cdots + a_{N-1} z^{-(N-1)} $$
We find its transfer function by appealing to standard results. We know that, if a transfer function has the following form: \begin{equation} H(z) = \frac{N(z)}{D(z)} \end{equation}
then the phase response is given by: \begin{equation} \Phi_{H}(\omega) = \angle N - \angle D \end{equation}
So we see that, since $N(z) = A(z^{-1}) = D(z^{-1})$, then $\angle N = - \angle D = -\angle A$. Similarly, we know that $\mathcal{F}\left\{ x(t-\tau)\right\} = e^{-j \omega \tau} \mathcal{F}\left\{ x(t) \right\}$, we have:
\begin{equation} \Phi_{H_{A}}(\omega) = -NT\omega - 2 \angle A(\omega) \end{equation}
where $T = \frac{1}{fs}$ is the spacing between samples, which we often set $T=1$ for a standardized design, and $\angle A(\omega) = \text{arg}\left[ A(\omega) \right]$. Plugging in, we get:
\begin{equation} \Phi_{H_{A}}(\omega) = -NT\omega - 2 \text{arctan}\left( \frac{ \displaystyle\sum_{n=0}^{N-1} a_{n} \text{sin}\left( \omega n T \right) }{ \displaystyle\sum_{n=0}^{N-1} a_{n} \text{cos}\left( \omega n T \right) } \right) \end{equation}
Complex Version:
There are multiple versions of what it means to be a complex all-pass filter in the literature. In [3], we have:
\begin{equation} H_{A}(z) = z^{-N} \frac{A^{\ast}(z^{-1})}{ A(z)} \end{equation} the corresponding phase response is: \begin{align} \Phi_{H_{A}}(\omega) &= -NT\omega + \angle N - \angle D \\ \Phi_{H_{A}}(\omega) &= -NT\omega + \left( - \angle A(\omega) - \angle A(\omega) \right) \\ \Phi_{H_{A}}(\omega) &= -NT\omega - 2 \angle A(\omega) \end{align} since $\mathcal{F}\left\{ x^{\ast}(-t)\right\} = X^{\ast}(\omega)$, and $\Phi_{X^{\ast}}(\omega) = -\Phi_{X}(\omega) $. And so, since $a_{n} = a_{n,r} + j a_{n,i}$ we have again:
\begin{equation} \Phi_{H_{A}}(\omega) = -NT\omega - 2 \text{arctan}\left( \frac{ \displaystyle\sum_{n=0}^{N-1} a_{n,i} \text{cos}\left( \omega n T \right) - a_{n,r} \text{sin}\left( \omega n T \right) }{ \displaystyle\sum_{n=0}^{N-1} a_{n,r} \text{cos}\left( \omega n T \right) + a_{n,i} \text{sin}\left( \omega n T \right) } \right) \end{equation}
[3] says, after bringing in the minus sign into the $\text{arctan}(\cdot)$ function:
\begin{equation} \Phi_{H_{A}}(\omega) = -NT\omega + 2 \text{arctan}\left( \frac{ \displaystyle\sum_{n=0}^{N-1} a_{n,r} \text{sin}\left( \omega n T \right) - a_{n,i} \text{cos}\left( \omega n T \right) }{ \displaystyle\sum_{n=0}^{N-1} a_{n,r} \text{cos}\left( \omega n T \right) + a_{n,i} \text{sin}\left( \omega n T \right) } \right) \end{equation}
However, [4] has it as: \begin{equation} H_{A}(z) = z^{-N} \frac{A(z^{-1})}{ A^{\ast}(z)} \end{equation} but the corresponding phase response is again back to: \begin{align} \Phi_{H_{A}}(\omega) &= -NT\omega + \angle N - \angle D \\ \Phi_{H_{A}}(\omega) &= -NT\omega + \left( - \angle A(\omega) - \angle A(\omega) \right) \\ \Phi_{H_{A}}(\omega) &= -NT\omega - 2 \angle A(\omega) \end{align} since $\mathcal{F}\left\{ x(-t)\right\} = X(-\omega)$, and so $\Phi_{X}(-\omega) = -\Phi_{X}(\omega)$, and $\mathcal{F}\left\{ x^{\ast}(t)\right\} = X^{\ast}(-\omega) $ and so $\Phi_{X^\ast}(-\omega) = -\Phi_{X^\ast} (\omega) = - (- \Phi_{X}(\omega)) = \Phi_{X}(\omega)$.
And so it should be:
\begin{equation} \Phi_{H_{A}}(\omega) = -NT\omega - 2 \text{arctan}\left( \frac{ \displaystyle\sum_{n=0}^{N-1} a_{n,i} \text{cos}\left( \omega n T \right) - a_{n,r} \text{sin}\left( \omega n T \right) }{ \displaystyle\sum_{n=0}^{N-1} a_{n,r} \text{cos}\left( \omega n T \right) + a_{n,i} \text{sin}\left( \omega n T \right) } \right) \end{equation}
but [4] has:
\begin{equation} \Phi_{H_{A}}(\omega) = -NT\omega + 2 \text{arctan}\left( \frac{ \displaystyle\sum_{n=0}^{N-1} a_{n,r} \text{sin}\left( \omega n T \right) + a_{n,i} \text{cos}\left( \omega n T \right) }{ \displaystyle\sum_{n=0}^{N-1} a_{n,r} \text{cos}\left( \omega n T \right) - a_{n,i} \text{sin}\left( \omega n T \right) } \right) \end{equation}
Question:
So who is right? What is the phase response of an $N$-th order all-pass filter?
References:
[1] D. Schlichthaerle, $\textit{Digital Filters: Basic and Design}$, 2nd ed. Heidelberg, Germany: Springer, 2011
[2] S. C. Pei and C. C. Tseng, "IIR Multiple Notch Filter Design Based on Allpass", IEEE TENCON, pp.267-272, 1996.
[3] M. Ikehara, M. Funaishi, and H. Kuroda, "Design of complex allpass networks using Remez algorithm," IEEE Trans. Circuits Syst. II, vol. 39, pp. 549–556, Aug. 1992.
[4] X. Zhang and H. Iwakura, "Design of IIR Digital Allpass Filters Based on Eigenvalue Problem", IEEE Trans. Sig. Proc., vol.47, no.2, pp.554-559, Feb. 1999.