Owners Manual

Here is another great post from Robert Orban dealing with an
esoteric audio topic that we also feel is very important, especially in
its relevance to brick wall anti-alias filters found in digital converters.
This was originally a 2 part post in rec.audio.pro that Robert editted
for the 'mastering forum' discussing digital EQ, etc: (9/17/2000)
Regarding the ability to “undo” IIR equalization: Provided that
the original IIR EQ is “minimum phase” (it means that all of the
z-plane zeros are within the unit circle, and is nearly always
true with conventional IIR eq), then a second pass where the
z-plane poles and zeros are swapped will completely undo
both the amplitude and phase changes caused by the first
pass. This will occur with arbitrary accuracy, limited only by
the bit depth of the arithmetic used to implement the filters.
The math is very simple:
A*(N/D)*(D/N) = A, where
A is the original signal
(N/D) is the z transform of the first-pass IIR filter, and
(D/N) is the z transform of the second-pass IIR filter, which
is the inverse of the first-pass filter.
In fact, it is substantially harder to undo FIR equalization of
the linear phase persuasion, because this is non-minimum-
phase (there are zeros outside the unit circle in the z-plane),
so a stable inverse filter does _not_ exist.
Further, FIR filters “mess up the transient response” too.
They just do so in a different way. The tap weights of the FIR
_define_ the impulse response of the filter. If you design the
filter to be linear phase, then the impulse response is
symmetrical around its center, and the part of the impulse
response containing significant energy is generally _longer_
than the impulse response of a minimum-phase IIR filter with
the same amplitude response as the FIR.
Further, the FIR impulse response will have pre-echo because
of its symmetry. The ear has much less ability to do temporal
masking of signals occurring _before_ the main energy lobe
of a transient than after. So the FIR’s pre-echo is much more
likely to be audible on transient material than the impulse
response of a minimum-phase IIR filter, where the impulse
response occurs _after_ the main energy lobe, and is shorter
(not counting the effects of the truncation of the FIR impulse
response at its ends).
In fact, the pre-echo of linear-phase FIR filter banks causes
notorious problems in the design of perceptual encoders.
Advanced coders have to adaptively switch filters depending
on the transient content of the program material in order to
suppress the audible effects of the pre-echoes. Castanets
are a standard means for testing the audibility of this
problem.
“Group delay,” unless constant with frequency, HAS NO
INTUITIVE PHYSICAL MEANING. (Mathematically, it is the
negative of the first derivative of the phase with respect to
frequency.)
It _certainly_ does not measure the “time delay” of a given
frequency. For example, most minimum-phase highpass filters
have _negative_ group delay in certainly frequency ranges.
Does this mean that their outputs emerge before their inputs
have been applied? Of course not.
In short, it is NOT USEFUL to talk about non-constant group
delay as if it had any relationship to time delay through a filter.
Further, there is a lot of careful academic research around
that indicates that the magnitude response of a given filter
is several orders of magnitude more audible that its group
delay response. People keep saying the one equalizer sounds
different from another because it has “phase shift.” But just
saying it over and over does not make it so.
Further...in the world of linear mathematics, time response
and frequency response are _uniquely_ related. If you know
the magnitude and phase response of a filter at all frequencies,
you can compute the time response. Conversely, if you know
the impulse response, you can compute the magnitude and
phase response.
This is where you have to be careful. A non-trivial linear-phase
filter (like a symmetrical FIR filter) has an impulse response
that is SPREAD OUT OVER TIME. The fact that the filter is
linear-phase DOES NOT MATTER. It STILL spreads energy out
over time. ALL filters “time-smear” their input signals—it is
literally how they work. They just do so in different ways.
Minimum-phase filters (like most IIR filters) and linear-phase
filters (like symmetrical FIR filters) have impulse responses
that are shaped very differently. The peak energy in the
impulse response of a minimum-phase filter is asymmetric in
time. The majority of the energy occurs right at the attack
point, and the energy trails out after that.
In contrast, linear-phase impulse response is symmetrical in
time, which means that they have a pre-echo exactly equal
to the post-echo.
We can either hand-wave about “phase shift errors,” or we
can refer to actual psychoacoustics. In psychoacoustics,
there is a phenomenon called “temporal masking,” which
means the degree to which the ear is desensitized to energy
occurring before and after a “masker,” which is a dominant
sound that “drowns out” other quieter sounds.
It just so happens that temporal masking is NOT symmetrical
in time. The ear has a much poorer ability to mask sounds
occurring _before_ the masker (like the pre-echo of an FIR
impulse response) than it is able to mask sounds occurring
_after_ the masker. So there is at one argument, based on
psychoacoustics, that indicates that a linear-phase filter, by
creating pre-echoes in its impulse response, is actually
_more_ likely to create audible artifacts that an minimum-
phase filter, which does not create pre-echoes.
Further, this is not just theory — it’s a well-known and very
serious problem in the design of lossy codecs like the beloved
MP3. Good codec designs have to take fairly heroic measures
(usually changing the characteristics of their filter banks
depending on whether a sound is “impulsive” or not) to
suppress the audible effects of the pre-echoes.
My point?
People in pro audio tend to throw around the term “phase
shift” without being at all careful. If you hear something
different in the sound of two filters, chances are you are
hearing differences in the shape of the magnitude response
curve, not “phase shift” effects.
And be very careful when assuming that “linear phase” is a
Good Thing in filters. It is, in fact, a pretty unnatural sound.
Most natural frequency-selective phenomena (like mechanical
responses) do _not_ have pre-echoes.