Skip to main content
Track Lowpass filter
1 / 9
Library

1991issue C041-4

Constructing a coincident moving average as a lowpass filter

A simple moving average is an equal-weight lowpass filter whose time-domain shape is a rectangular pulse. Lookback can be chosen from how much a named cycle shrinks, how far that cycle is delayed, and how far price typically travels around a centered mean.

  • A simple moving average gives every observation inside a finite window equal weight and every observation outside that window zero weight, which makes it a lowpass filter with a rectangular pulse in the time domain.
  • Attenuation follows a sine-over-argument frequency response: 0.637 when the cycle period is twice the window, and 0.9 when the period is four times the window.
  • Phase lag scales linearly with window length, except that a full-cycle window has zero amplitude at the first sign change of that response and an indeterminate phase delay.
  • Exponential smoothing keeps more high-frequency variation and less lag than an equal-weight window, while lookback should also reflect how far price travels around a centered average.
Entries in this reading3 entries

A rectangular window is a lowpass filter

A simple moving average is built by giving every observation inside a finite window equal weight and every observation outside that window zero weight. That construction is a lowpass filter whose time-domain shape is a rectangular pulse.

The resulting average can be plotted on the current bar and scored for amplitude loss and delay. Window length is the number of sampling intervals given nonzero weight.

Attenuation of a named cycle

The frequency response of that rectangular window is a sine-over-argument curve whose argument, in radians, equals pi times window length divided by the cycle period under study.

When the cycle period is twice the averaging window, the simple-moving-average attenuation equals 0.637. When the cycle period is four times the averaging window, the simple-moving-average attenuation equals 0.9, with one-fourth of that cycle inside the window at any chosen phase.

Attenuation is the reduction in cycle amplitude caused by averaging, stated as the ratio of filter output to the input cycle.

Phase lag grows with window length

Phase lag of a simple moving average scales linearly with window length. A half-cycle window lags by a quarter cycle, or 90 degrees, and a quarter-cycle window lags by 45 degrees.

A full-cycle simple moving average would imply a half-cycle lag, but its phase delay is indeterminate because the output amplitude is exactly zero at the first sign change of the sine-over-argument response.

Frequency response of a simple moving-average window

A simple average is a rectangular window, so a named cycle shrinks by sin(x)/x with x equal to π times window length over that cycle’s period. A cycle twice the window keeps 0.637 of its amplitude, a cycle four times the window keeps 0.90, and a full-cycle window is the first zero (complete cancellation, then sign reversal in the sidelobes). Those are Ehlers’s printed formula and worked examples, not a tracing of the schematic pulse drawing.
A simple average is a rectangular window, so a named cycle shrinks by sin(x)/x with x equal to π times window length over that cycle’s period. A cycle twice the window keeps 0.637 of its amplitude, a cycle four times the window keeps 0.90, and a full-cycle window is the first zero (complete cancellation, then sign reversal in the sidelobes). Those are Ehlers’s printed formula and worked examples, not a tracing of the schematic pulse drawing.

Closed form is for a simple moving average. Ehlers treats it as a first-order stand-in for an EMA, which cuts high frequencies less sharply and lags less. At a full-cycle window amplitude is exactly zero, so phase delay is undefined.

First-order averages and a softer cutoff

The attenuation and lag relations apply to simple moving averages. Exponential smoothing retains more high-frequency variation because its cutoff is less sharp, and it introduces less lag.

For first-order averages, the simple-moving-average attenuation and lag figures are treated as reasonable approximations. Exponential smoothing is a first-order average that weights recent observations more heavily than an equal-weight window of similar reach.

Offset from extremes and travel around the mean

The vertical offset of an advanced, coincident-plotted average from price extremes is the sum of attenuation, which reduces that offset, and a scale effect, which increases it. As the window lengthens, the scale effect dominates. That net price-point offset is the vertical displacement after amplitude loss and the competing scale effect are combined.

Lookback should also reflect how far price travels around a centered average. A narrow range can use a shorter window, while a wide range with large gaps needs a longer one. Those centered-mean excursions are the typical travel of price around an average aligned to the middle of its window.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
1 of 9 in the Lowpass filter track
19941-3 pp.Next on Lowpass filterCentering a dual lowpass bandpass on a counted cycleA bandpass series is the difference of two three-pole lowpass recurrences that share the same closing-price input and differ only by cutoff period.
All readings on this track · 9 readings
  1. 1991Constructing a coincident moving average as a lowpass filter
  2. 1994Centering a dual lowpass bandpass on a counted cycle
  3. 1997Zero-lag cycle filters can fail on a price series
  4. 2002Constructing zero-lag finite-impulse-response and exponential smoothers
  5. 2010Constructing cycle versus trend mode filters
  6. 2010Constructing a trend filter as a low-frequency model
  7. 2015Whitened lowpass filters for trend and countertrend
  8. 2016Building Nyquist-safe lowpass trend filters
  9. 2018Constructing a Finite Impulse Response Filter compared with Exponential smoothing
All 13 readings tagged Lowpass filter
Also on Lowpass filter5 readings