A zero-phase filter cannot be causal (except in the trivial case when the filter is a constant scale factor ). However, in many ``off-line'' applications, such as when filtering a sound file on a computer disk, causality is not a requirement, and zero-phase filters are often preferred.
This follows immediately from writing the DTFT of in terms of a cosine and sine transform:
A real frequency response has phase zero when it is positive, and phase when it is negative. Therefore, we define a zero-phase filter as follows:
Recall from §7.5.2 that a passband is defined as a frequency band that is ``passed'' by the filter, i.e., the filter is not designed to minimize signal amplitude in the band. For example, in a lowpass filter with cut-off frequency rad/s, the passband is .
Under our definition, a zero-phase filter always has a real, even impulse response [ ], but not every real, even, impulse response is a zero-phase filter. For example, if is zero phase, then is not; however, we could call a ``-phase filter'' if we like (a zero-phase filter in series with a sign inversion).
Practical zero-phase filters are zero-phase in their passbands, but may switch between 0 and in their stopbands (as illustrated in the upcoming example of Fig.10.2). Thus, typical zero-phase filters are more precisely described as piecewise constant-phase filters, where the constant phase is 0 in all passbands, and over various intervals within stopbands. Similarly, practical ``linear phase'' filters are typically truly linear phase across their passbands, but typically exhibit discontinuities by radians in their stopband(s). As long as the stopbands are negligible, which is the goal by definition, the -phase regions can be neglected completely.
Example Zero-Phase Filter Design
Figure 10.1 shows the impulse response and frequency response of a length 11 zero-phase FIR lowpass filter designed using the Remez exchange algorithm.11.2 The matlab code for designing this filter is as follows:
N = 11; % filter length - must be odd b = [0 0.1 0.2 0.5]*2; % band edges M = [1 1 0 0 ]; % desired band values h = remez(N-1,b,M); % Remez multiple exchange designThe impulse response h is returned in linear-phase form, so it must be left-shifted samples to make it zero phase.
Figure 10.2 shows the amplitude and phase responses of the FIR filter designed by remez. The phase response is zero throughout the passband and transition band. However, each zero-crossing in the stopband results in a phase jump of radians, so that the phase alternates between zero and in the stopband. This is typical of practical zero-phase filters.
Elementary Zero-Phase Filter Examples
- The trivial (non-)filter
has frequency response
, which is zero phase for all .
- Every second-order zero-phase FIR filter has an impulse
response of the form
- Extending the previous example, every order zero-phase real FIR
filter has an impulse response of the form
and frequency response
- There is no first-order (length 2) zero-phase filter, because,
to be even, its impulse response would have to be proportional to
. Since the bandlimited digital
impulse signal is ideally interpolated using bandlimited
interpolation [91,84], giving samples of
unit-amplitude sinc function having zero-crossings on the
integers, we see that sampling on the integers yields
an IIR filter:
- Similarly, there are no odd-order (even-length) zero-phase filters.
Odd Impulse Reponses
Linear-Phase Filters (Symmetric Impulse Responses)