I keep being interested in allpass filters. An allpass changes a signal’s phase only, leaving the magnitude spectrum untouched. This article is about a 2nd-order allpass design I’ve been working on for phase alignment of crossovers in active loudspeakers.
Crossover phase alignment
In loudspeaker design, an allpass is sometimes used to alter the phase of one driver’s output relative to another, to bring the drivers in-phase in the crossover band (the range of frequencies in which both drivers are sounding). Crossovers are usually designed so their electrical outputs sum in-phase, but several factors (e.g. physical offset between drivers, electro-mechanical response of the drivers and enclosure, phase shifts due to equalization filters) can cause phase shifts resulting in acoustic signals at the listening position that no longer sum in-phase. An allpass filter can correct this.
Phase alignment is usually corrected (if at all) with either a first-order allpass or pure delay. Because each of these has just one control parameter, exact phase alignment can generally be achieved at only one frequency. A mathematician would say the resulting phase alignment is correct to “zeroth order”.
“First-order” alignment would require not only that the phase difference between drivers be zero at the crossover frequency, but also that the derivative of the phase difference be zero. This is equivalent to asking that the relative group delay between drivers be zero at the crossover point (since group delay is the negative derivative of the phase response with respect to frequency). First-order correction needs an allpass with at least two parameters.
If we ask that our allpass also have approximately constant group delay, then we’re aiming at 2nd-order correction since this requires control of the phase response up to the second derivative, hence needing an allpass with at least three parameters. I won’t address this further: currently we’re doing no better than zeroth-order correction.
First-order phase alignment is desirable since it would bring the drivers’ outputs in-phase across a wider range of frequencies, centered on the crossover frequency. At the end of this article I give design equations for a biquad digital filter that can be used for first-order alignment.
There seems to some confusion around this. People often speak of “delaying” the output of one driver to “time align” it with another, when what they’re actually doing is what I’ve called “zeroth-order phase alignment”: they’re using a one-parameter allpass to correct phase, with no ability to separately control group delay. “Time alignment” is a higher-order goal, requiring correction of both phase and group delay at the crossover point, hence needing an allpass with at least two control parameters.
Example: Linkwitz Pluto 2.1
In my implementation of the Linkwitz Labs Pluto 2.1 (an excellent two-way active loudspeaker) the uncorrected acoustic phase between woofer and tweeter at the listening position looks like this:
The smoothed blue curve gives us the phase response of the ideal allpass filter which, if applied to the tweeter signal, would put the drivers in-phase throughout the crossover band. (The 1kHz crossover here is 24dB/oct, so aligning phase over a one-octave band would be plenty good).
To achieve zeroth-order alignment we could use any allpass that gives -108° of phase at 1kHz. To achieve first-order alignment, our allpass needs -108° of phase and 0.22ms group delay at 1kHz (since the woofer-tweeter relative group delay τ=-dφ/dω estimated from the graph above is about 0.22ms at 1kHz).
Alignment with a pure delay
Digital implementations of the Pluto xover/eq usually employ a pure delay for phase alignment. The phase response of a pure delay is φ=-τω where τ is the amount of delay. From this we can calculate that a delay of τ=0.30ms will give the targeted -108° phase correction at 1kHz (actually we would have to round the delay to the nearest integer multiple of the sampling period, which at 44.1kHz sampling would be 0.29ms, only a 2% error). Here is the woofer-tweeter relative phase after we apply our 0.3ms delay to the tweeter:
The drivers are now acoustically in-phase at 1kHz. This is a zeroth-order correction, since the relative phase doesn’t have zero slope at 1kHz: we’ve added a bit too much group delay (0.30 – 0.22 = 0.08ms too much). But the drivers are well within 45° throughout the crossover band, so this is perfectly acceptable. Still, I’m interested in how we can do better. (As a mathematician, I’m big on solutions that are looking for problems.)
Alignment with a first-order allpass
The analog implementation of Pluto 2.1 uses a couple of 1st-order allpasses for phase alignment. If we use just one such (non-inverting) allpass, it needs a transition frequency of 723Hz to give -108° of phase at 1kHz. The corrected woofer-tweeter phase then looks like this:
This is pretty good. The relative phase has non-zero slope at 1kHz, so again we have only zeroth-order alignment: we’ve added the right amount of phase, but not enough group delay. (The analog Pluto 2.1 actually uses a chain of two allpasses to ensure each is operating in a region of constant group delay. I won’t graph this case, so I can get to my real point below.)
Alignment with a 2nd-order allpass
A second-order allpass, since it has two parameters, would give us control over both phase and group delay (phase slope) at the crossover frequency. As noted above, to achieve first-order alignment our allpass needs to have -108° phase and 0.22ms group delay at 1kHz. Fortunately it isn’t hard to design such a thing: a 2nd-order analog allpass with transition frequency 14390Hz and Q=0.388 does it. (I’ve written a short white paper that gives a derivation of the design equations.) The corrected woofer-tweeter phase looks like this:
Now both the phase difference and its slope (i.e. relative group delay) are zero at the crossover point. We’ve added just the right amount of group delay along with the right phase shift at the crossover point. The result is very accurate alignment, throughout a band centered on the crossover frequency where alignment matters most. (Alignment matters less the further you get from the crossover point: at the -12dB point a 45° mis-alignment causes only 0.5dB of ripple in the summed response.) This allpass isn’t being operated in a region of constant group delay but that’s secondary: as I’ve said, asking for constant group delay is aiming for 2nd-order correction.
Our 2nd-order allpass is easily implemented as a digital biquad filter, with filter coefficients derived using a bilinear transform. This requires some care in compensating for frequency warping: it isn’t the allpass transition frequency that needs to be pre-warped (as would usually the case) but the crossover frequency. We also need to pre-warp the target group delay, since the bilinear transform warps that as well.
In case anyone is interested in using this, here are my design equations for biquad filter coefficients that give a 2nd-order allpass with φ radians of phase and group delay τ [sec] at the crossover frequency ω [rad/sec], with sampling period T [sec]:
where the numerator coefficients are b0=a2, b1=a1, b2=a0=1 (as for any allpass). See my white paper for the math details.
The filter coefficients for the Pluto 2.1 example, in case you want to try them, are as follows:
a0 = b2 = 1
a1 = b1 = -1.34171751075671807918
a2 = b0 = 0.41601629618125030019