# Phase Response of $N$-th order Digital All-Pass Filter

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 , 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}$$

 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,  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  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:

 D. Schlichthaerle, $$\textit{Digital Filters: Basic and Design}$$, 2nd ed. Heidelberg, Germany: Springer, 2011

 S. C. Pei and C. C. Tseng, "IIR Multiple Notch Filter Design Based on Allpass", IEEE TENCON, pp.267-272, 1996.

 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.

 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.

So who is right?

Both, I think. On first looks version  and version  use different definitions of $$A(z)$$.  conjugates the zeros and  conjugates the poles. Either one will probably work but the definition of the coefficients is different. Specifically the $$a$$ coefficients of version  or conjugates of those of version .

So you have

$$a_{n,i,v3} = -a_{n,i,v4}$$

So if your complex allpass is

$$H(z) = \frac{(1-j)/2+z^{-1}}{1+(1+j)/2 \cdot z^{-1}}$$

 would say $$a_1 = (1+j)/2$$ and  defines $$a_1 = (1-j)/2$$

• So they both will work out? I haven't built them to test this, but it doesn't really matter which one you conjugate? Jul 20 at 16:33
• Personally I'd go with  especially if you use the notation of $a$ and $A$. That typically is used for the pole polynomial.  uses $a$ as the "conjugates of the pole polynomial" which feels weird to me. Jul 20 at 18:03
• Yea I would say that  seems more natural too. Thanks! Jul 20 at 18:19