Jump to content

Linear phase

From Wikipedia, the free encyclopedia

In signal processing, linear phase is a property of a filter where the phase response of the filter is a linear function of frequency. The result is that all frequency components of the input signal are shifted in time (usually delayed) by the same constant amount (the slope of the linear function), which is referred to as the group delay. Consequently, there is no phase distortion due to the time delay of frequencies relative to one another.

Zero-phase filters are a special case of linear-phase filters where the group delay is zero. In non-real-time digital signal processing, this can be obtained from any linear-phase filter simply by shifting the filtered output of a linear-phase filter backwards in time by the linear-phase filter's group delay, so sometimes all linear-phase filters are loosely referred to as zero-phase filters.[1][2]

For discrete-time signals, perfect linear phase is easily achieved with a finite impulse response (FIR) filter by having coefficients which are symmetric or anti-symmetric.[3] Approximations can be achieved with infinite impulse response (IIR) designs, which are more computationally efficient. Several techniques are:

  • a Bessel transfer function which has a maximally flat group delay approximation function
  • a phase equalizer

Definition

[edit]

A filter is called a linear phase filter if the phase component of the frequency response is a linear function of frequency. For a continuous-time application, the frequency response of the filter is the Fourier transform of the filter's impulse response, and a linear phase version has the form:

where:

  • A(ω) is a real-valued function.
  • is the group delay.

For a discrete-time application, the discrete-time Fourier transform of the linear phase impulse response has the form:

where:

  • A(ω) is a real-valued function with 2π periodicity.
  • k is an integer, and k/2 is the group delay in units of samples.

is a Fourier series that can also be expressed in terms of the Z-transform of the filter impulse response. I.e.:

where the notation distinguishes the Z-transform from the Fourier transform.

Examples

[edit]

When a sinusoid  passes through a filter with constant (frequency-independent) group delay   the result is:

where:

  • is a frequency-dependent amplitude multiplier.
  • The phase shift is a linear function of angular frequency , and is the slope.

It follows that a complex exponential function:

is transformed into:

[note 1]

For approximately linear phase, it is sufficient to have that property only in the passband(s) of the filter, where |A(ω)| has relatively large values. Therefore, both magnitude and phase graphs (Bode plots) are customarily used to examine a filter's linearity. A "linear" phase graph may contain discontinuities of π and/or 2π radians. The smaller ones happen where A(ω) changes sign. Since |A(ω)| cannot be negative, the changes are reflected in the phase plot. The 2π discontinuities happen because of plotting the principal value of   instead of the actual value.

In discrete-time applications, one only examines the region of frequencies between 0 and the Nyquist frequency, because of periodicity and symmetry. Depending on the frequency units, the Nyquist frequency may be 0.5, 1.0, π, or ½ of the actual sample-rate.  Some examples of linear and non-linear phase are shown below.

Bode plots. Phase discontinuities are π radians, indicating a sign reversal.
Phase discontinuities are removed by allowing negative amplitude.
Two depictions of the frequency response of a simple FIR filter

A discrete-time filter with linear phase may be achieved by an FIR filter which is either symmetric or anti-symmetric.[4]  A necessary but not sufficient condition is:

for some .[5]

Bidirectional filtering

[edit]

In digital signal processing, infinite impulse response (IIR) LTI filters are usually much more computationally efficient than FIR filters, but they almost never have linear phase behavior. When the signal processing takes place offline, however, any arbitrary LTI filter can be made zero-phase by bidirectional filtering or forward-backward filtering: running the filter twice, the second time with time reversed.[1][6] (For a causal filter, this second pass is anti-causal, so using this approach in real time has not been shown to be possible.) This cancels out the variable phase delays resulting from the first pass and squares the filter's gain at each frequency; for a bandpass filter, this results in twice the stopband attenuation and twice the passband ripple.[7]

Most popular signal processing software such as SciPy, Octave, and R has a built-in function for this purpose, usually called filtfilt.[8][9][10]

Generalized linear phase

[edit]

Systems with generalized linear phase have an additional frequency-independent constant added to the phase. In the discrete-time case, for example, the frequency response has the form:

for

Because of this constant, the phase of the system is not a strictly linear function of frequency, but it retains many of the useful properties of linear phase systems.[11]

See also

[edit]

Notes

[edit]
  1. ^ The multiplier , as a function of ω, is known as the filter's frequency response.

Citations

[edit]
  1. ^ a b Smith, Ph.D., Steven W. "19.4. Recursive Filters: Phase Response". The Scientist and Engineer's Guide to Digital Signal Processing. p. 328. Retrieved 2026-01-08.
  2. ^ Smith, Julius O. (2007). "Zero-Phase Filters (Even Impulse Responses)". Introduction to Digital Filters with Audio Applications. W3K Publishing. ISBN 978-0-9745607-1-7. Retrieved 2026-01-08.
  3. ^ Selesnick, Ivan. "Four Types of Linear-Phase FIR Filters". Openstax CNX. Rice University. Retrieved 27 April 2014.
  4. ^ Selesnick, Ivan. "Four Types of Linear-Phase FIR Filters". Openstax CNX. Rice University. Retrieved 27 April 2014.
  5. ^ Oppenheim, Alan V; Ronald W Schafer (1975). Digital Signal Processing (3 ed.). Prentice Hall. ISBN 0-13-214635-5.
  6. ^ Lyons, Richard G. (2004). "13.12. DSP Tricks: Doing Zero-phase filtering". Understanding Digital Signal Processing (Second ed.). pp. 518–519. ISBN 0-13-108989-7. Retrieved 2026-01-08.
  7. ^ "What is zero-phase filtering and forward-backward filtering?". Signal Processing Stack Exchange. 2018-11-24. Retrieved 2026-01-09.
  8. ^ "scipy.signal.filtfilt — SciPy v1.16.2 Manual". Retrieved 2026-01-08.
  9. ^ "function reference: filtfilt — Octave Forge". Retrieved 2026-01-08.
  10. ^ "filtfilt: Forward and reverse filter a signal (in package "signal")". Retrieved 2026-01-08.
  11. ^ Oppenheim, Alan V; Ronald W Schafer (1975). Digital Signal Processing (1 ed.). Prentice Hall. ISBN 0-13-214635-5.