DSPRelated.com

Wiener Filter

Category: Adaptive

A Wiener filter is a linear, statistically optimal filter that minimizes the mean square error (MSE) between its output and a desired signal, given knowledge (or estimates) of the signal and noise power spectral densities. It operates by shaping the frequency response to suppress noise while preserving signal content, weighted by how much each frequency band is dominated by signal versus noise.

In practice

In embedded signal processing, the Wiener filter appears most often in audio noise reduction, sensor data denoising, and channel equalization. The classical formulation requires knowledge of the second-order statistics of both the target signal and the noise -- such as autocorrelation and cross-correlation functions, or equivalently their power spectral densities for stationary signals; in practice these are estimated from data, either offline during a calibration phase or adaptively at runtime. On resource-constrained MCUs, the full frequency-domain Wiener filter is rarely implemented directly due to FFT overhead and memory cost; a fixed FIR approximation derived offline is more common.

The filter transfer function is H(f) = S_xx(f) / (S_xx(f) + S_nn(f)), where S_xx is the signal PSD and S_nn is the noise PSD. When SNR is high at a given frequency, H approaches 1 and the signal passes through. When SNR is low, H suppresses that band. This behavior makes it a natural fit for applications where noise has a known or slowly varying spectral character, such as thermal sensor noise or ambient acoustic noise with a stable spectrum.

A key practical challenge is that the optimal Wiener filter changes whenever the signal or noise statistics change. On targets with enough compute (Cortex-M4/M7 with FPU, or DSP-class SoCs), adaptive algorithms such as LMS or RLS can update filter coefficients in real time to track non-stationary conditions by iteratively converging toward the current Wiener solution. On smaller 8-bit or 16-bit targets, a static Wiener filter computed offline and baked in as a fixed-coefficient FIR is the typical compromise.

Wiener filters assume stationarity and linearity, which limits their effectiveness on signals with abrupt transients or non-stationary noise. For those cases, time-frequency approaches (short-time Fourier transform segmentation, or wavelet-domain denoising as discussed in blog posts like "Discrete Wavelet Transform Filter Bank Implementation (part 1)" and "Wavelets II - Vanishing Moments and Spectral Factorization") can outperform a global Wiener filter by applying frequency-dependent thresholding locally in time.

Discussed on DSPRelated

Frequently asked

What information do I need to design a Wiener filter?
You need estimates of the power spectral density of the desired signal (S_xx) and the noise (S_nn). In practice, S_nn is often estimated during a known-quiet calibration period, and S_xx is estimated from the noisy observation by subtracting the noise PSD estimate. The quality of the filter depends directly on the accuracy of these PSD estimates.
How does a Wiener filter differ from a standard FIR or IIR lowpass filter?
A lowpass filter (Butterworth, Chebyshev, etc.) shapes the response based on a fixed cutoff and roll-off, regardless of the actual signal or noise content. A Wiener filter adapts its response frequency-by-frequency based on the ratio of signal power to noise power at each frequency. In a band where noise dominates, a Wiener filter can attenuate aggressively even if that band is within the nominal signal passband.
Can a Wiener filter be implemented as a standard FIR on a microcontroller?
Yes. One common approach is to derive the Wiener solution in the frequency domain offline, then convert it to a finite-length FIR approximation via inverse DFT and windowing; another is to solve the Wiener-Hopf equations directly in the time domain from an autocorrelation matrix. Either way, the resulting coefficient array can be stored in flash and applied using a standard MAC loop or a CMSIS-DSP FIR function on Cortex-M targets. The trade-off is that this fixed FIR will only be optimal for the statistics used during design.
What is the relationship between the Wiener filter and adaptive algorithms like LMS?
The Wiener filter defines the statistically optimal solution; LMS and RLS algorithms are iterative methods that converge toward that solution without requiring explicit PSD estimation. LMS updates coefficients incrementally each sample using a gradient-descent step, making it feasible in real time on MCUs with modest compute. The steady-state LMS solution approximates the Wiener solution when the step size is small and the noise is stationary.
What are the main failure modes of a Wiener filter in embedded applications?
Non-stationary noise is the most common problem: if the noise PSD changes faster than the filter is updated or redesigned, the filter becomes suboptimal or can even amplify noise at some frequencies. The filter also assumes the signal and noise are uncorrelated and that both are wide-sense stationary; violations of these assumptions degrade performance. Finally, short data records produce high-variance PSD estimates, leading to noisy filter coefficients.

Differentiators vs similar concepts

The Wiener filter is sometimes conflated with matched filters and adaptive filters. A matched filter maximizes SNR at one specific sampling instant and is optimized for detection, not continuous waveform reconstruction. The Wiener filter minimizes MSE across the entire output waveform, making it better suited for signal estimation and denoising. Adaptive filters (LMS, RLS) are algorithms that iteratively converge toward the Wiener solution; the Wiener filter itself is the static optimal target, not an algorithm. A Kalman filter solves a related but distinct problem: for linear systems with Gaussian noise it shares a deep theoretical connection with the Wiener filter, but it is formulated in state-space and time-domain terms and handles non-stationary signals recursively -- making it more general in some respects, but also reliant on a different set of modeling assumptions.