A: Allpass filters are filters that have what we call a flat frequency response; they neither emphasize nor de-emphasize any part of the spectrum. Rather, they displace signals in time as a function of frequency. The time displacement accomplished by an allpass filter is specified by its phase response. Allpass filters are used in circuit design to perform various frequency-dependent time-alignment or time-displacement functions. Audio applications include filter banks, speaker crossovers, and reverberators. Allpass filters appear in both continuous- and discrete-time applications.
Figure 1, above, shows the transfer function of an allpass filter. The top graph in the figure shows the magnitude response of the filter. This is the filter's gain as a function of frequency. As can be seen, the filter has unity gain over the audio band. The lower graph shows the phase response of the filter. The phase response is related to the time delay encountered by the signal's frequency components. At a given frequency, time delay is related to phase shift by the equation = *where is phase, is frequency, and is time. As can be seen, the phase response changes as a function of frequency.
Use of extremely-high-order allpass filters can lead to different bands of a signal
becoming misaligned in time. This misalignment cannot be reduced or “undone” by
addition of more allpass filters.
This allpass filter is commonly referred to as a phase rotator. It is used in radio broadcast to reduce the peak level of signals. Often, peaks in signals are transient events: Energy is localized in time, producing a short period of high level. Transients can be produced by percussive instruments, plucked/struck instruments, or other natural sources. Due to the uncertainty principle, transients are necessarily broadband events, where energy is localized in time, but distributed over a wide range of frequencies. The phase rotator tends to reduce the peak amplitude of transients by spreading out in time the frequency components that combine to produce the transients. Effectively, the phase rotator smears transients, making them less localized. As long as the smearing occurs on a time scale less than 5-10ms, it is unlikely that the phase rotator will produce significant perceptual artifacts for humans.
Figure 2, above, shows the impulse response for the phase rotator. This filter will smear energy over a few hundred samples (5ms at a sampling rate of 44100). As can be seen, the peak value for the impulse response is about 0.63. This means that if a unit impulse is fed into the phase rotator, the peak value at the output will be only 0.63, which is down by about 4 dB. For a pure impulse, the phase rotator thus reduces peak level by 4 dB. For real-world signals, the peak-level reduction is not as dramatic, since real-world peaks are already somewhat smeared in time. Figure 3, below, shows a time plot of a drum track, along with a plot of the track after being processed by a phase rotator. For this signal, peaks have been reduced by about 1.6 dB by the phase rotator. Depending on the signal, the phase rotator can be an effective way to reduce dynamic range.
Check out the audio examples below. Can you hear the difference? You may be able to. However, the difference may be acceptable in order to gain 1.6 dB of headroom.
Allpass filters are often used in digital reverberators. Typically, for this application, the allpass filter is constructed as in Figure 4, using a bulk delay with feedforward and feedback paths. The filter gains are chosen so that the filter is spectrally white, but the delay line leads to a phase response, which is a strong function of frequency. The impulse response for this form of filter is a decaying sequence of equally spaced impulses. The spacing between the impulses is determined by the delay line length.
Because of the spectral whiteness of the filter of Figure 4, it may be expected that the impulse response will sound uncolored. However, this is not always the case. Listen to this typical allpass impulse response. The impulse response sounds colored, and seems to emphasize a single frequency and its harmonics. However, taking the Fourier transform of the impulse response would reveal that the filter's spectrum is flat. What has happened is that certain frequencies have been delayed a tremendous amount by the allpass filter. These frequencies produce the “tone” or “pitch” of the impulse response. All other frequencies are represented equally in the impulse response in terms of energy, but are contained within the (short) beginning of the impulse response. The impulse response thus consists of a broadband, impulsive segment, which contains most frequencies, followed by a longer tail which consists mostly of a single frequency and its harmonics. In light of this, it should be noted that a spectrally flat filter may not always sound “flat” if it produces huge phase delays at some frequencies.
Other applications for allpass filters include matching phase between different signals. For example, allpass filters can be used to time-align different components of a filter bank or speaker crossover. In general, it is often possible to produce an allpass filter that has a larger phase lag at higher frequencies relative to lower frequencies. It is difficult, however, to create a stable allpass filter that has a decreasing phase lag as frequency increases. Thus, use of extremely-high-order allpass filters can lead to different bands of a signal becoming misaligned in time. This misalignment cannot be reduced or “undone” by addition of more allpass filters. As a rule of thumb, the phase mismatch between low and high frequencies will be twice as much for an allpass filter as it would for a minimum phase filter of the same order.
Allpass filters have many audio applications. If impulse response lengths are kept low, these filters can modify signal phase in a transparent way. With longer impulse responses, allpass filters can be used to create audible effects while preserving the spectral balance of a signal.
Please consult the "Ask the Doctor" archives for additional discussions of linear phase EQ and phase shift.
— Dave Berners