One version of a second-order allpass filter has a recursion equation:
y(n) = a*x(n) + x(n-2) - a*y(n-2)
and transfer function
H(z) = (a + z**-2) / (1 + a*z**-2)
The phase of the filter can be obtained by substituting z = exp(jw) in the above and computing the arctan of the ratio of the imaginary and real parts of H(w).
The phase is also given by the equation
1) theta(w) = -2*arctan{ (1 - a) * tan(w) / (1 + a) }
and by the more cumbersome equation
2) theta(w) = arctan[(a**2-1)*sin(2*w) / { (a**2+1)*cos(2*w)+2*a}]
I derived the second equation by substituting exp(jw) for z in H(z) and multiplying the numerator and denominator by the conjugate of the denominator; the phase angle is then the arctan of the ratio of the imaginary and real parts of the numerator. I thought perhaps eq. 2 could be transformed into eq. 1 by substituting the trig identities for sin(2w) and cos(2w) but that led nowhere. There evidently is a way of arriving at eq. 1 but I haven't found it. Any suggestions? I'm not looking for the complete derivation, just the general approach.
Thanks in advance. Gary Richardson