The FIR Filter as a Matrix-Vector Product
A finite impulse response (FIR) filter with coefficients h = [h₀, h₁, ..., h_{M−1}] computes each output sample as a weighted sum of the M most recent input samples. For a block of N input samples collected into a vector x, the entire output vector y is produced by the matrix-vector product y = Hx, where H is the Toeplitz convolution matrix.
This matrix perspective reframes filter design as a question: which matrix H — equivalently, which coefficient vector h — produces the best output? "Best" depends on our criterion. The most tractable and widely used criterion is least squares: minimize the sum of squared differences between the actual output and some desired output.
Once the filter is cast as a matrix, the entire machinery of linear algebra — projections, orthogonality, eigendecompositions — can be brought to bear on filter design. Optimal filters emerge as solutions to linear systems, not as ad-hoc design recipes.
Specifying What We Want: The Desired Response
In supervised filter design, we have access to a desired signal d[n] — what the output should ideally be — and an input signal x[n]. For each time index n, we stack M past input samples into the regressor vector:
Collecting N pairs of regressors and desired samples into the matrix X (N×M) and vector d (N×1), the goal is to find the coefficient vector h that makes Xh as close to d as possible in the least-squares sense.
Least Squares Filter Design
The least squares problem minimizes the total squared error between the filter output and the desired signal over N samples:
Setting the gradient ∂J/∂h = 0 yields the normal equations — the hallmark of least-squares problems. These are M linear equations in M unknowns, with a positive semidefinite coefficient matrix.
The least-squares solution projects the desired vector d onto the subspace spanned by the columns of X (i.e., the set of all achievable filter outputs). The error vector d − Xh* is orthogonal to every column of X — the hallmark of orthogonal projection.
The Wiener Filter: Optimal in MSE Sense
When signals are modeled as stationary random processes, the optimal filter minimizes the mean squared error (MSE) E[|d[n] − y[n]|²]. Taking expectations replaces the empirical matrices with their statistical counterparts:
- R = E[x[n]xᵀ[n]] — the M×M autocorrelation matrix of the input
- p = E[d[n]x[n]] — the M×1 cross-correlation vector between the desired signal and the input
The MSE-optimal filter satisfies the Wiener-Hopf equation:
The Wiener filter is the statistical analog of the least-squares filter — the two coincide in the limit of large N. In practice, the true statistics R and p are unknown and must be estimated from data, leading to the sample (data-driven) Wiener filter.
Eigenstructure of the Autocorrelation Matrix
Because R is symmetric positive definite, it admits an eigendecomposition R = QΛQᵀ. The eigenvectors Q are the principal directions of the input signal's power distribution, and the eigenvalues λ₁ ≥ λ₂ ≥ ... ≥ λ_M > 0 are the powers in those directions. The Wiener filter solution can be expressed in the eigenbasis as:
Adaptive Filters: LMS and RLS
In practice, signal statistics change over time (non-stationarity), or we may have insufficient data to estimate R and p reliably. Adaptive filters update their coefficients online, tracking changing statistics without needing to store or invert large matrices.
Least Mean Squares (LMS)
The LMS algorithm approximates the gradient of the MSE cost with an instantaneous estimate, using a single input-error sample pair to update h:
Recursive Least Squares (RLS)
RLS minimizes the weighted sum of all past squared errors, updating the inverse autocorrelation matrix P = (XᵀX)⁻¹ recursively using the matrix inversion lemma (Sherman-Morrison-Woodbury formula). RLS converges in exactly M steps (for exact arithmetic) and tracks non-stationarity much faster than LMS, at the cost of O(M²) operations per update instead of O(M).
Beamforming as a Linear Algebra Problem
An array of K antennas receives the same signal from a direction θ, each with a different phase shift. The received vector at time n is z[n] = a(θ)s[n] + n[n], where a(θ) is the steering vector (the array response to a signal from direction θ), s[n] is the desired signal, and n[n] is noise plus interference.
A beamformer applies a weight vector w to the antenna array output: y[n] = wᴴz[n]. The goal is to choose w to pass the signal from direction θ₀ while suppressing noise and interference from other directions.
Beamforming is thus a constrained least-squares problem: minimize quadratic form wᴴR_zw subject to the linear constraint wᴴa = 1. The solution follows directly from Lagrange multipliers and the matrix inverse — a beautiful application of the linear algebra we've built throughout this course.
FIR filters are Toeplitz matrix-vector products; designing them optimally means solving a least-squares problem via the normal equations (XᵀX)h = Xᵀd. The statistical analog is the Wiener filter, given by the Wiener-Hopf equation Rh = p, where R is the input autocorrelation matrix and p is the cross-correlation with the desired signal. The eigenstructure of R governs both filter performance and conditioning. Adaptive algorithms (LMS, RLS) track changing statistics online: LMS approximates the gradient at O(M) cost; RLS uses the matrix inversion lemma at O(M²) cost for exact least-squares updates. Beamforming is a constrained quadratic optimization over antenna weights, solvable with a single matrix inverse — the MVDR beamformer.