What are Digital Filters? (Moving Average, Butterworth, Kalman)

Digital FilterMoving AverageButterworthSignal ProcessingDSP

Digital filters are algorithms that suppress unwanted components (noise, interference, vibration) in a signal after it has been digitized by an ADC. Every filter trades noise reduction against response speed; the right one depends on the character of the signal and of the noise.

Common filter types

FilterFormula / principleStrengthWeakness
Moving average (MA)Mean of the last N samplesSimple, reduces random noiseDelay grows with N
Exponential (EMA)y[n] = α·x[n] + (1−α)·y[n−1]Little memory, one parameterStep response settles slowly
MedianMiddle value of the last N samplesRejects isolated spikesHigher computational cost
Butterworth (IIR)Maximally flat passbandClearly defined cutoffPhase delay varies with frequency
KalmanWeighted blend of model prediction and measurementEffective for dynamic systemsNeeds a model and noise parameters

A Butterworth filter is -3 dB at its cutoff frequency (fc), and above fc attenuation increases by 20 dB/decade per order. A 2nd-order filter therefore attenuates a component at 10 × fc by about 40 dB (a factor of 100); saying it "cuts off" everything above fc is not accurate. Extensions of the Kalman filter for non-linear systems are covered in Advanced Filtering.

Worked example: moving average

A moving average with N = 20 samples at a 1 kHz sampling rate:

  • Window length: 20 × 1 ms = 20 ms. That is exactly one period of 50 Hz, so the filter has zero gain at 50 Hz and its multiples and strongly rejects mains interference.
  • Noise reduction: uncorrelated random noise falls by about √N = √20 ≈ 4.5 times.
  • Delay: group delay is (N − 1) / 2 = 9.5 samples ≈ 9.5 ms.

With N = 200, noise falls about 14 times but delay rises to roughly 100 ms; in filling control that delay can cause overshoot.

Common mistakes

  • Using a digital filter in place of the anti-aliasing filter that belongs before sampling. A digital filter cannot separate a component that has already folded through aliasing.
  • Heavy filtering in tests where the peak value matters; the filter under-reads the peak.
  • Raising the filter setting without fixing the source of noise (wiring, grounding) (see Noise).
  • Ignoring filter delay inside a control loop.

Where are they used in industry?

Stable readings on weighing indicators, weighbridges on vibrating ground, dosing control and cleaning up force curves on test machines are typical uses of digital filters. The Amazeng GDT Digital Transmitter includes an adaptive digital filter that can be adjusted manually or automatically to suppress interference and noise. For AI-based approaches, see Smart Transmitters: AI Noise Filtering.

Related Terms