A linear filter obeys the superposition principle: filtering gives . Many familiar examples are also linear time-invariant systems, represented by an impulse response and convolution. Linearity alone does not imply time invariance: multiplying by the index is linear but changes its behavior when the same input is shifted.
The moving average is a finite impulse response example implemented by arithmetic; a band-pass filter can instead be built from a series RLC circuit. Their frequency responses explain which oscillations pass through. Choosing a filter means choosing how much amplitude, timing and detail may change, not simply removing every visible fluctuation.
For a linear time-invariant system, a sinusoidal wanted signal at and an unwanted sinusoidal component at acquire their separate frequency response factors. The ratio of their output amplitudes, divided by their input amplitude ratio, is . An amplitude attenuation factor of corresponds to a factor in squared-amplitude power ratios under a common impedance convention. The unwanted component's own absolute attenuation is , which need not equal its attenuation relative to the wanted signal.
A low-pass filter preferentially transmits low frequencies and attenuates higher frequencies. It can smooth rapid noise in a slowly varying signal, but it also suppresses wanted variations outside the useful signal bandwidth. An RC low-pass filter gives a concrete continuous-time example; a moving average implements related smoothing on a discrete-time signal.
The useful question is how much change the measurement can tolerate. Preserving the low frequencies of a temperature record while reducing a fast unwanted oscillation can improve readability. Preserving the sharp onset of a pulse requires higher frequencies, so excessive smoothing changes its timing and shape. The RC low-pass frequency response and RC low-pass step response make this signal bandwidth versus settling time tradeoff quantitative.
A maximally flat passband magnitude design. A normalized second-order low-pass denominator is . An equal-component Sallen-Key low-pass filter realizes this damping when , with the corresponding non-inverting passband gain.
A second-order active low-pass architecture using a non-inverting amplifier and a resistor-capacitor network with output feedback into the network. For the convention with from source to A, from A to the non-inverting input, from that input to ground and from A to output, and . The poles, not merely finite values of , determine whether a settled sinusoidal response exists.[ref]
For equal frequency-setting resistors and capacitors , write . The denominator is . With positive , asymptotic stability requires ; at the ideal poles are imaginary, and larger gain gives right-half-plane poles. In particular gives , a repeated unstable pole. A finite formal gain curve must not be confused with stable filter operation.
An RL circuit with the output measured across its resistor is a first-order low-pass filter. For an ideal inductor, an ideal voltage source and a high-resistance output instrument, the electrical impedances and give
The gain approaches one at low angular frequency and at high angular frequency; at it is . The time-domain equation is and , so the time constant is . Instrument loading, source resistance and nonideal inductance can change the response.
An RC low-pass filter places a resistor between input and output, with a capacitor from output to their common return. The ideal model prescribes the input electric potential difference and leaves the output unloaded. It is a first-order low-pass filter with unit eventual gain.[ref]
Figure 1. . Original schematic: the output is across the capacitor, not across the resistor. The orange dashed resistor is the optional electrical load used in RC low-pass output loading; omit it for the ideal unloaded model. The blue arrow defines positive electric current through . Details.
For electrical resistance and capacitance , Ohm's law gives the electric current through the resistor as . The capacitor relation gives . Equating them by Kirchhoff's current law yields the ordinary differential equation
The time constant has units of time. A rapid change in electric potential difference requires a large electric current into the capacitor; the finite electrical resistance limits that rate. A slowly maintained voltage instead lets the capacitor approach the input voltage. The same equation therefore predicts both smoothing of sustained oscillations and a rounded response to a sudden change.
For the original constructed example throughout this article, take
These stipulated ideal values specify an analytical model, rather than measurements of particular components.
For an equal-duty square wave alternating between with period , the steady periodic capacitor voltage has extrema . A positive half-period maps to , proving the title formula. The negative half-period is its sign-reversed copy. Short periods give a small nearly triangular output; long periods give input-like plateaux with exponential transitions.
Use the complex amplitude convention , where is the angular frequency and is the frequency in cycles per second. Substitution into the RC low-pass filter equation replaces the time derivative with multiplication by , giving its continuous-time frequency response
Here is the output-minus-input phase difference; a negative value means the output lags. Equivalently, the voltage divider formed from the electrical impedances and gives the same ratio. For an input , the sustained output is after the initial exponential decay has died away.
Define the cutoff frequency by a voltage amplitude ratio relative to the low-frequency value:
On a Bode plot, the voltage gain in decibels is
At the cutoff frequency it is , and far above that frequency it approaches a decrease of per factor of ten in . There is a smooth transition rather than an abrupt wall. The squared voltage ratio is one half at the corner; converting that statement to a power ratio requires the same real electrical resistance for the compared voltages. It does not mean that an unloaded capacitor dissipates half the source power.
For and , the cutoff frequency is . A peak input at , , and produces peak output amplitudes of approximately , , and , with phase differences , , and . Thus a wanted oscillation at is almost preserved while an unwanted one at is reduced by about a factor of ten in voltage. The superposition principle lets these two responses be added when both oscillations occur in the same signal.
The step response describes a sudden persistent input change. Suppose the input becomes a constant at , and the initial capacitor voltage is . Finite electric current leaves that voltage continuous. Subtract from the RC low-pass filter equation: the remaining error satisfies . Separating variables gives
For an initially uncharged capacitor and a to step in the constructed example,
At one time constant, , the voltage is , about of its final value. The voltage error then continues its exponential decay. This is different from a pure delay: the output starts changing immediately, yet takes time to approach the target.
Figure 1. . Original analytical curves for and ; no experimental points. Left: a Bode plot of voltage gain and output-minus-input phase difference, with cutoff frequency . Right: the response to a to step, compared with doubling at fixed . Doubling the time constant halves the cutoff frequency and doubles the time to reach the same fraction of the final voltage. Details.
Define settling time relative to the total voltage change: require thereafter, with . The exponential decay is monotone, so
For settling, ; the to rise takes . Reducing the cutoff frequency by doubling doubles both times. This reciprocal relation is the useful connection between signal bandwidth and response speed: stronger suppression of rapid noise comes with slower tracking of wanted changes.
A real electrical load can draw electric current from the output. For a load resistor across the capacitor, Kirchhoff's current law instead gives
Therefore the loaded continuous-time frequency response is
Loading reduces the eventual gain and shortens the time constant. With the constructed values and , , , and the corner relative to the loaded low-frequency gain moves to . A step now approaches . A quicker rise alone would conceal the error in the final voltage.
With the ideal input voltage source set to zero, the output impedance seen by the electrical load is
This follows from Thévenin's theorem: the resistor and capacitor are then in parallel. A sufficient small-loading condition is over the frequencies of interest. An oscilloscope is itself an electrical load: its input electrical resistance and cable or probe capacitance can both change the response. Pure extra parallel capacitance increases and lowers the corner, whereas a finite parallel electrical resistance gives the different gain-and-corner changes above.
The definition of input also matters. If voltage is prescribed inside a source with series electrical resistance , the unloaded response to that internal source uses . If the actual voltage at the filter input terminal is measured, the ratio of output to that measured input still uses . Measuring both terminals avoids mistaking a source setting for the voltage delivered to the filter.
The University of Colorado Boulder's Lab 3: Filters, §§7.1–7.4, specifies measuring the resistor and capacitor, then driving the assembled RC low-pass filter with a function generator. A two-channel oscilloscope reads actual input and output using high electrical impedance. Sweep the frequency, record the voltage amplitude ratio, and locate . A control compares a cable with a oscilloscope probe on a resistive voltage divider, isolating measurement capacitance before using the probe for the filter. A slow square wave then lets discharge timing estimate the time constant independently. Agreement supports the RC low-pass frequency response; source output impedance, probe loading, and instrument signal bandwidth limit it. These are prescribed measurements, with no measured dataset supplied here.[ref]
The two-channel setup can also test the predicted phase difference directly: for positive frequency , measure the output's time lag between corresponding features of the two sinusoids. For this single-stage model the phase lies between and , so choose the lag within a quarter cycle and calculate . At the cutoff frequency the predicted lag is one eighth of a cycle. This tests the timing part of the frequency response as well as the voltage ratio.
A causal filter uses only present and past input values to produce its current output. The trailing moving average is causal; a centered average that uses future samples is not. Future samples can be available when processing a finished recording, but they are unavailable to a live measurement at the current time.
A linear time-invariant system has finite impulse response when its impulse response is nonzero at only finitely many indices. For a causal filter supported at indices ,
This is a finite discrete convolution. The coefficients specify the complete operation; they need not be positive or equal. Such a filter has a simple bounded-input estimate, , so bounded inputs remain bounded. The moving average chooses .
A moving average replaces each value by an average over a moving window of neighboring values. The simple trailing version with positive integer window length is the causal filter
It is a finite impulse response linear time-invariant system. A constant input remains unchanged because the weights sum to one. Weighted and centered averages are other choices; the definition of the window determines both the weights and whether future values are needed.
For an exact five-sample example, let
defined at every integer index. The first component completes one cycle in forty samples and the second in five. Averaging five consecutive samples cancels the second component exactly. The first becomes
The remaining component is slightly smaller and delayed by two samples; the filter does not recover the original component unchanged.
Figure 1.
A five-sample moving average cancels one sinusoid while attenuating and delaying another
. Details.
The example is in steady operation: its early output values use the specified negative-index samples. Starting a device at with an unknown past requires an initialization rule. Treating earlier samples as zero, shortening the initial window, and postponing output until a full window is available produce different initial values.
For zero-mean uncorrelated random variables with common variance , the averaged disturbance has
The standard deviation decreases by , but successive filtered errors share samples and are generally correlated. This variance calculation also assumes the wanted component is not damaged by averaging. A rapidly changing feature can be suppressed along with the disturbance.
The frequency response explains the cancellation and limits of this method. A moving average preserves low frequencies comparatively well, yet its side lobes make it a poor substitute for a sharply selective frequency cutoff. Smith develops this time-domain versus frequency-domain distinction in The Scientist and Engineer's Guide to Digital Signal Processing, chapter 15: moving-average filters.
A band-pass filter preferentially transmits signals within a range of frequencies and attenuates sufficiently lower and higher frequencies. Taking the output voltage across the resistor in a series RLC circuit gives one example: the resonant series RLC response selects a band around . [ref].
A series resistor and capacitor feed a parallel pair with the same values. Measuring the parallel pair's voltage relative to the return gives this unloaded transfer function for phasors proportional to . The voltage divider applied to and proves the formula. The amplitude peaks at with ratio and zero relative phase. At low and high positive frequencies, the transfer function tends respectively to and . Reversing output polarity changes its sign, while loading changes the response itself.
A chosen boundary in a frequency response, commonly where the voltage amplitude gain falls to of its pass-region value. The convention must specify the reference gain.
The angular frequency corresponding to a specified filter cutoff frequency. For a first-order RC low-pass filter, the half-power convention gives and .

Articles by others on the same topic (1)

A linear filter is a mathematical operation applied to signals or images that processes the input data in a way that satisfies the principles of linearity. Linear filters are widely used in signal processing, image processing, and communications for various purposes including noise reduction, signal enhancement, and feature extraction.