Minimum-Phase Filters

This chapter discusses minimum-phase signals and filters, the minimum-phase/allpass decomposition, and hybrid minimum-phase/linear-phase audio filters. Matlab code is given for computing minimum-phase spectra from spectral magnitude only.

Definition of Minimum Phase Filters

In Chapter 10 we looked at linear-phase and zero-phase digital filters. While such filters preserve waveshape to a maximum extent in some sense, there are times when phase linearity is not important. In such cases, it is valuable to allow the phase to be arbitrary, or else to set it in such a way that the amplitude response is easier to match. In many cases, this means specifying minimum phase:

$\textstyle \parbox{0.8\textwidth}{An LTI filter $H(z)=B(z)/A(z)$\ is said to be...
...e unit circle $\left\vert z\right\vert=1$\ (excluding
the unit circle itself).}$

Note that minimum-phase filters are stable by definition since the poles must be inside the unit circle. In addition, because the zeros must also be inside the unit circle, the inverse filter $ 1/H(z)$ is also stable when $ H(z)$ is minimum phase. One can say that minimum-phase filters form an algebraic group in which the group elements are impulse-responses and the group operation is convolution (or, alternatively, the elements are minimum-phase transfer functions, and the group operation is multiplication).

A minimum phase filter is also causal since noncausal terms in the impulse response correspond to poles at infinity. The simplest example of this would be the unit-sample advance, $ H(z) = z$, which consists of a zero at $ z=0$ and a pole at $ z=\infty$.12.1


Minimum-Phase Polynomials

A filter is minimum phase if both the numerator and denominator of its transfer function are minimum-phase polynomials in $ z^{-1}$:

$\textstyle \parbox{0.8\textwidth}{A polynomial of the form
\par\begin{center}\b...
...$\ are inside the unit circle, \textit{i.e.}, $\left\vert\xi_i\right\vert<1$.
}$
The case $ b_0=0$ is excluded because the polynomial cannot be minimum phase in that case, because then it would have a zero at $ z=\infty$ unless all its coefficients were zero.

As usual, definitions for filters generalize to definitions for signals by simply treating the signal as an impulse response:

$\textstyle \parbox{0.8\textwidth}{A signal $h(n)$, $n\in{\bf Z}$, is said to be minimum phase
if its {\it z} transform\ $H(z)$\ is minimum phase.
}$

Note that every stable all-pole filter $ H(z)=b_0/A(z)$ is minimum phase, because stability implies that $ A(z)$ is minimum phase, and there are ``no zeros'' (all are at $ z=0$). Thus, minimum phase is the only phase available to a stable all-pole filter.

The contribution of minimum-phase zeros to the complex cepstrum was described in §8.8.


Maximum Phase Filters

The opposite of minimum phase is maximum phase:

$\textstyle \parbox{0.8\textwidth}{%
A stable LTI filter $H(z)=B(z)/A(z)$\ is said to be \emph{maximum
phase} if all its zeros are outside the unit circle.}$
For example, every stable allpass filterB.2) is a maximum-phase filter, because its transfer function can be written as

$\displaystyle H(z)=\frac{z^{-N}A(z^{-1})}{A(z)},
$

where $ A(z)=1+a_1z^{-1}+a_2z^{-2}+\cdots+a_N z^{-N}$ is an $ N$th-order minimum-phase polynomial in $ z^{-1}$ (all roots inside the unit circle). As another example of a maximum-phase filter (a special case of allpass filters, in fact), a pure delay of $ N$ samples has the transfer function $ z^{-N}$, which is $ N$ poles at $ z=0$ and $ N$ zeros at $ z=\infty$.

If zeros of $ B(z)$ occur both inside and outside the unit circle, the filter is said to be a mixed-phase filter. Note that zeros on the unit circle are neither minimum nor maximum phase according to our definitions. Since poles on the unit circle are sometimes called ``marginally stable,'' we could say that zeros on the unit circle are ``marginally minimum and/or maximum phase'' for consistency. However, such a term does not appear to be very useful. When pursuing minimum-phase filter design (see §11.7), we will find that zeros on the unit circle must be treated separately.

If $ B(z)$ is order $ M$ and minimum phase, then $ z^{-M}B(z^{-1})$ is maximum phase, and vice versa. To restate this in the time domain, if $ b=[b_0,b_1,\ldots,b_M,0,\ldots]$ is a minimum-phase FIR sequence of length $ M+1$, then SHIFT$ _M($FLIP$ (b))$ is a maximum-phase sequence. In other words, time reversal inverts the locations of all zeros, thereby ``reflecting'' them across the unit circle in a manner that does not affect spectral magnitude. Time reversal is followed by a shift in order to obtain a causal result, but this is not required: Adding a pure delay to a maximum-phase filter ( $ B(z)
\to z^{-1}B(z)$) gives a new maximum-phase filter with the same amplitude response (and order increased by 1).

Example

It is easy to classify completely all first-order FIR filters:

$\displaystyle H(z) = 1 + h_1 z^{-1}
$

where we have normalized $ h_0$ to 1 for simplicity. We have a single zero at $ z=-h_1$. If $ \left\vert h_1\right\vert< 1$, the filter is minimum phase. If $ \left\vert h_1\right\vert>1$, it is maximum phase. Note that the minimum-phase case is the one in which the impulse response $ [1,h_1,0,\ldots]$ decays instead of grows. It can be shown that this is a general property of minimum-phase sequences, as elaborated in the next section.


Minimum Phase Means Fastest Decay

The previous example is an instance of the following general result:

$\textstyle \parbox{0.8\textwidth}{%
Among all causal signals $h_i(n)$\ having i...
...K \left\vert h_i(n)\right\vert^2,
\qquad K=0,1,2,\ldots\,.
\end{displaymath}}$
That is, the signal energy in the first $ K+1$ samples of the minimum-phase case is at least as large as any other causal signal having the same magnitude spectrum. (See [60] for a proof outline.) Thus, minimum-phase signals are maximally concentrated toward time 0 when compared against all causal signals having the same magnitude spectrum. As a result of this property, minimum-phase signals are sometimes called minimum-delay signals.


Minimum-Phase/Allpass Decomposition

Every causal stable filter $ H(z)$ with no zeros on the unit circle can be factored into a minimum-phase filter in cascade with a causal stable allpass filter:

$\displaystyle H(z) \eqsp H_{\hbox{mp}}(z)\,S(z)
\qquad\hbox{(Minimum-Phase/Allpass Decomposition)}
$

where $ H_{\hbox{mp}}(z)$ is minimum phase, $ S(z)$ is a stable allpass filter:

$\displaystyle S(z) \eqsp \frac{s_L + s_{L-1}z^{-1}+ \cdots + s_1 z^{-(L-1)} + z^{-L}}
{1 + s_1z^{-1}+ s_2 z^{-2}+ \cdots + s_L z^{-L}},
$

and $ L$ is the number of maximum-phase zeros of $ H(z)$.

This result is easy to show by induction. Consider a single maximum-phase zero $ \xi$ of $ H(z)$. Then $ \left\vert\xi\right\vert>1$, and $ H(z)$ can be written with the maximum-phase zero factored out as

$\displaystyle H(z) \eqsp H_1(z) (1-\xi z^{-1}).
$

Now multiply by $ 1=(1-\xi^{-1}z^{-1})/(1-\xi^{-1}z^{-1})$ to get

$\displaystyle H(z) \eqsp \underbrace{H_1(z) (1-\xi^{-1}z^{-1})}_{\displaystyle\...
...nderbrace{\frac{1-\xi z^{-1}}{1-\xi^{-1}z^{-1}}}_{\displaystyle\isdef S_1(z)}.
$

We have thus factored $ H(z)$ into the product of $ H_2(z)$, in which the maximum-phase zero has been reflected inside the unit circle to become minimum-phase (from $ z=\xi$ to $ z=1/\xi$), times a stable allpass filter $ S_1(z)$ consisting of the original maximum-phase zero $ \xi$ and a new pole at $ z=1/\xi$ (which cancels the reflected zero at $ z=1/\xi$ given to $ H_2(z)$). This procedure can now be repeated for each maximum-phase zero in $ H(z)$.

In summary, we may factor maximum-phase zeros out of the transfer function and replace them with their minimum-phase counterparts without altering the amplitude response. This modification is equivalent to placing a stable allpass filter in series with the original filter, where the allpass filter cancels the maximum-phase zero and introduces the minimum-phase zero.

A procedure for computing the minimum phase for a given spectral magnitude is discussed in §11.7 below. More theory pertaining to minimum phase sequences may be found in [60].


Is Linear Phase Really Ideal for Audio?

It is generally accepted that zero or linear phase filters are ideal for audio applications. This is because such filters delay all frequencies by the same amount, thereby maximally preserving waveshape. Mathematically, all Fourier-components passed by the filter remain time-synchronized exactly as they were in the original signal. However, this section will argue that a phase response somewhere between linear- and minimum-phase may be even better in some cases. We show this by means of a Matlab experiment comparing minimum-phase and zero-phase impulse responses.

The matlab code is shown in Fig.11.1. An order $ 8$ elliptic-function lowpass filter [64] is designed with a cut-off frequency at 2 kHz. We choose an elliptic-function filter because it has a highly nonlinear phase response near its cut-off frequency, resulting in extra delay there which can be perceived as ``ringing'' at that frequency. The cut-off is chosen at 2kHz because this is a highly audible frequency. We want to clearly hear the ringing in this experiment in order to compare the zero-phase and minimum-phase cases.

Figure 11.1: Matlab script for listening to minimum-phase and zero-phase impulse responses having the same amplitude response.

 
% ellipt.m - Compare minimum-phase and zero-phase
%            lowpass impulse responses.

dosounds = 1;
N = 8;     % filter order
Rp = 0.5;  % passband ripple (dB)
Rs = 60;   % stopband ripple (-dB)
Fs = 8192; % default sampling rate (Windows Matlab)
Fp = 2000; % passband end
Fc = 2200; % stopband begins [gives order 8]
Ns = 4096; % number of samples in impulse responses

[B,A] = nellip(Rp, Rs, Fp/(0.5*Fs), Fc/(0.5*Fs)); % Octave
% [B,A] = ellip(N, Rp, Rs, Fp/(0.5*Fs)); % Matlab

% Minimum phase case:
imp = [1,zeros(1,Ns/2-1)]; % or 'h1=impz(B,A,Ns/2-1)'
h1 = filter(B,A,imp); % min-phase impulse response
hmp = filter(B,A,[h1,zeros(1,Ns/2)]); % apply twice

% Zero phase case:
h1r = fliplr(h1); % maximum-phase impulse response
hzp = filter(B,A,[h1r,zeros(1,Ns/2)]); % min*max=zp
% hzp = fliplr(hzp); % not needed here since symmetric

elliptplots; % plot impulse- and amplitude-responses

% Let's hear them!
while(dosounds)
  sound(hmp,Fs);
  pause(0.5);
  sound(hzp,Fs);
  pause(1);
end

Let the impulse response of the $ 8$th order lowpass filter be denoted $ h(n)$. It is neither minimum nor maximum phase because there are zeros on the unit circle. (An elliptic-function filter has all of its zeros on the unit circle.) However, nothing of practical importance changes if we move the zeros from radius 1 to radius $ 1-10^{-12}$, say, which would give a minimum-phase perturbation of the elliptic lowpass.

From $ h(n)$ we prepare two impulse responses having the same magnitude spectra but different phase spectra:

$\displaystyle h_{\hbox{\tiny mp}}\isdef h\ast h,
$

which is minimum phase,12.2 and

$\displaystyle h_{\hbox{\tiny zp}}\isdef h\ast$   FLIP$\displaystyle (h),
$

which is zero phase, as discussed in §10.6. In both cases, the magnitude spectrum is

$\displaystyle \left\vert H_{\hbox{mp}}(e^{j\omega T})\right\vert \eqsp \left\ve...
...zp}}(e^{j\omega T})\right\vert \eqsp \left\vert H(e^{j\omega T})\right\vert^2,
$

while the phase spectra are

\begin{eqnarray*}
\angle{H_{\hbox{mp}}(e^{j\omega T})} &=& 2\angle{H(e^{j\omega T})}\\
\angle{H_{\hbox{zp}}(e^{j\omega T})} &=& 0,
\end{eqnarray*}

again as discussed in §10.6.

Since we are listening to a lowpass-filtered impulse, it is reasonable to define the ideal expected sound as a ``lowpass-filtered click,'' or some kind of ``compact thump.'' We may therefore ask which signal sounds more like a lowpassed click, $ h_{\hbox{\tiny mp}}$ or $ h_{\hbox{\tiny zp}}$? In the minimum-phase case, all filter ringing occurs after the main pulse, while in the zero-phase case, it is equally divided before and after the main pulse (see Fig.11.2). Listening tests confirm that the ``pre-ring'' of the zero-phase case is audible before the main click, giving it a kind of ``chirp'' quality. Most listeners would say the minimum-phase case is a better ``click''. Since forward masking is stronger than backward masking in hearing perception, the optimal distribution of ringing is arguably a small amount before the main pulse (however much is inaudible due to backward masking, for example), with the rest occurring after the main pulse.

Figure 11.2: Minimum-phase and zero-phase impulse responses derived from two applications of an order $ 8$ elliptic-function lowpass filter.
\includegraphics[width=\twidth]{eps/elliptt}

Figure 11.3 verifies that the magnitude spectra are the same in each case.

Figure 11.3: Magnitude spectra of minimum-phase and zero-phase impulse responses derived from two passes through an order 8 elliptic-function lowpass filter.
\includegraphics[width=\twidth]{eps/elliptf}


Creating Minimum Phase Filters
and Signals

Minimum-phase filter design often requires creating a minimum-phase desired frequency response $ H(e^{j\omega})$ from a given magnitude response $ \left\vert H(e^{j\omega})\right\vert$). As is clear from §11.5, any filter transfer function $ H(z)$ can be made minimum-phase, in principle, by completely factoring $ H(z)$ and ``reflecting'' all zeros $ z_i$ for which $ \vert z_i\vert>1$ inside the unit circle, i.e., replacing $ z_i$ by $ 1/z_i$. However, factoring a polynomial this large can be impractical. An approximate ``nonparametric'' method12.3is based on the property of the complex cepstrum (see §8.8) that each minimum-phase zero in the spectrum gives rise to a causal exponential in the cepstrum, while each maximum-phase zero corresponds to an anti-causal exponential in the cepstrum [60]. Therefore, by computing the cepstrum and converting anti-causal exponentials to causal exponentials, the corresponding spectrum is converted nonparametrically to minimum-phase form.

A matlab function mps.m which carries out this method is listed in §J.11.12.4It works best for smooth desired frequency response curves, but in principle the error can be made arbitrarily small by simply enlarging the FFT sizes used. Specifically, the inverse FFT of the log magnitude frequency response should not ``wrap around'' in the time domain (negligible ``time aliasing'').

It is important to use something like mps when designing digital filters based on a magnitude frequency-response specification using ``phase sensitive'' filter-design software (such as invfreqz in matlab). In other words, poor results are generally obtained when phase-sensitive filter-design software is asked to design a causal, stable, zero-phase filter. As a general rule, when phase doesn't matter, ask for minimum phase.

A related practical note is that unstable recursive filter designs can often be stabilized by simply adding more delay to the desired impulse response (i.e., adding a negatively sloped linear phase to the desired phase response). For example, the Steiglitz-McBride algorithm in Matlab (stmcb) is a phase-sensitive IIR filter-design function that accepts a desired impulse response, while Matlab's invfreqz (which can optionally iterate toward the Steiglitz-McBride solution), accepts a complex desired frequency response.


Next Section:
Conclusion
Previous Section:
Filters Preserving Phase