Least mean squares filter

Short description: Statistical algorithm

This article includes a list of references, but its sources remain unclear because it has insufficient inline citations. Please help to improve this article by introducing more precise citations. (January 2019) (Learn how and when to remove this template message)

|

Least mean squares (LMS) algorithms are a class of adaptive filter used to mimic a desired filter by finding the filter coefficients that relate to producing the least mean square of the error signal (difference between the desired and the actual signal). It is a stochastic gradient descent method in that the filter is only adapted based on the error at the current time. It was invented in 1960 by Stanford University professor Bernard Widrow and his first Ph.D. student, Ted Hoff, based on their research into single-layer neural networks. Specifically, they used gradient descent to train an ADALINE to recognize patterns, and called the algorithm "delta rule". They applied the rule to filters, resulting in the LMS algorithm.

## Contents

* 1 Problem formulation
* 1.1 Relationship to the Wiener filter
* 1.2 Definition of symbols
* 2 Idea
* 3 Derivation
* 4 Simplifications
* 5 LMS algorithm summary
* 6 Convergence and stability in the mean
* 7 Normalized least mean squares filter (NLMS)
* 7.1 Optimal learning rate
* 7.2 Proof
* 8 See also
* 9 References
* 10 External links

## Problem formulation

The picture shows the various parts of the filter. x is the input signal, which is then transformed by an unknown filter h that we wish to match using h^. The output from the unknown filter is y, which is then interfered with a noise signal ν, producing d=y+ν. Then the error signal e=d−y^=y+ν−y^ is computed, and it is fed back to the adaptive filter, to adjust its parameters in order to minimize the mean squared error, ∑e2/n.

### Relationship to the Wiener filter

The realization of the causal Wiener filter resembles the solution to the least squares estimate, except in the signal processing domain. The least squares solution for input matrix 𝐗 and output vector y is

β^=(𝐗𝐓𝐗)−1𝐗𝐓y.

The finite impulse response (FIR) least mean squares filter is related to the Wiener filter, but minimizing the error criterion of the former does not rely on cross-correlations or auto-correlations. Its solution converges to the Wiener filter solution. Most linear adaptive filtering problems can be formulated using the block diagram above. That is, an unknown system 𝐡(n) is to be identified and the adaptive filter attempts to adapt the filter 𝐡^(n) to make it as close as possible to 𝐡(n), while using only observable signals x(n), d(n) and e(n); but y(n), v(n) and h(n) are not directly observable. Its solution is closely related to the Wiener filter.

### Definition of symbols

n is the number of the current input sample
p is the number of filter taps
{⋅}H (Hermitian transpose or conjugate transpose)
𝐱(n)=[x(n),x(n−1),…,x(n−p+1)]T
𝐡(n)=[h0(n),h1(n),…,hp−1(n)]T,𝐡(n)∈ℂp
y(n)=𝐡H(n)⋅𝐱(n)
d(n)=y(n)+ν(n)
𝐡^(n) estimated filter; interpret as the estimation of the filter coefficients after n samples
e(n)=d(n)−y^(n)=d(n)−𝐡^H(n)⋅𝐱(n)

## Idea

The basic idea behind LMS filter is to approach the optimum filter weights (R−1P), by updating the filter weights in a manner to converge to the optimum filter weight. This is based on the gradient descent algorithm. The algorithm starts by assuming small weights (zero in most cases) and, at each step, by finding the gradient of the mean square error, the weights are updated. That is, if the MSE-gradient is positive, it implies the error would keep increasing positively if the same weight is used for further iterations, which means we need to reduce the weights. In the same way, if the gradient is negative, we need to increase the weights. The weight update equation is

Wn+1=Wn−μ∇ε[n],

where ε represents the mean-square error and μ is the learning rate coefficient.

The negative sign shows that we go down the slope of the error, ε to find the filter weights, Wi, which minimize the error.

The mean-square error as a function of filter weights is a quadratic function which means it has only one extremum, that minimizes the mean-square error, which is the optimal weight. The LMS thus, approaches towards this optimal weights by ascending/descending down the mean-square-error vs filter weight curve.

## Derivation

The idea behind LMS filters is to use steepest descent to find filter weights 𝐡^(n) which minimize a cost function. We start by defining the cost function as

C(n)=E{|e(n)|2}

where e(n) is the error at the current sample n and E{⋅} denotes the expected value.

This cost function (C(n)) is the mean square error, and it is minimized by the LMS. This is where the LMS gets its name. Applying steepest descent means to take the partial derivatives with respect to the individual entries of the filter coefficient (weight) vector

∇𝐡^HC(n)=∇𝐡^HE{e(n)e*(n)}=2E{∇𝐡^H(e(n))e*(n)}

where ∇ is the gradient operator

∇𝐡^H(e(n))=∇𝐡^H(d(n)−𝐡^H⋅𝐱(n))=−𝐱(n)
∇C(n)=−2E{𝐱(n)e*(n)}

Now, ∇C(n) is a vector which points towards the steepest ascent of the cost function. To find the minimum of the cost function we need to take a step in the opposite direction of ∇C(n). To express that in mathematical terms

𝐡^(n+1)=𝐡^(n)−μ2∇C(n)=𝐡^(n)+μE{𝐱(n)e*(n)}

where μ2 is the step size (adaptation constant). That means we have found a sequential update algorithm which minimizes the cost function. Unfortunately, this algorithm is not realizable until we know E{𝐱(n)e*(n)}.

Generally, the expectation above is not computed. Instead, to run the LMS in an online (updating after each new sample is received) environment, we use an instantaneous estimate of that expectation. See below.

## Simplifications

For most systems the expectation function E{𝐱(n)e*(n)} must be approximated. This can be done with the following unbiased estimator

E^{𝐱(n)e*(n)}=1N∑i=0N−1𝐱(n−i)e*(n−i)

where N indicates the number of samples we use for that estimate. The simplest case is N=1

E^{𝐱(n)e*(n)}=𝐱(n)e*(n)

For that simple case the update algorithm follows as

𝐡^(n+1)=𝐡^(n)+μ𝐱(n)e*(n)

Indeed, this constitutes the update algorithm for the LMS filter.

## LMS algorithm summary

The LMS algorithm for a pth order filter can be summarized as

Parameters: | p= filter order

|

| μ= step size
Initialisation: | 𝐡^(0)=zeros⁡(p)
Computation: | For n=0,1,2,...

𝐱(n)=[x(n),x(n−1),…,x(n−p+1)]T

| e(n)=d(n)−𝐡^H(n)𝐱(n)
| 𝐡^(n+1)=𝐡^(n)+μe*(n)𝐱(n)

## Convergence and stability in the mean

As the LMS algorithm does not use the exact values of the expectations, the weights would never reach the optimal weights in the absolute sense, but a convergence is possible in mean. That is, even though the weights may change by small amounts, it changes about the optimal weights. However, if the variance with which the weights change, is large, convergence in mean would be misleading. This problem may occur, if the value of step-size μ is not chosen properly.

If μ is chosen to be large, the amount with which the weights change depends heavily on the gradient estimate, and so the weights may change by a large value so that gradient which was negative at the first instant may now become positive. And at the second instant, the weight may change in the opposite direction by a large amount because of the negative gradient and would thus keep oscillating with a large variance about the optimal weights. On the other hand, if μ is chosen to be too small, time to converge to the optimal weights will be too large.

Thus, an upper bound on μ is needed which is given as 0<μ<2λmax,

where λmax is the greatest eigenvalue of the autocorrelation matrix 𝐑=E{𝐱(n)𝐱H(n)}. If this condition is not fulfilled, the algorithm becomes unstable and h^(n) diverges.

Maximum convergence speed is achieved when

μ=2λmax+λmin,

where λmin is the smallest eigenvalue of 𝐑. Given that μ is less than or equal to this optimum, the convergence speed is determined by λmin, with a larger value yielding faster convergence. This means that faster convergence can be achieved when λmax is close to λmin, that is, the maximum achievable convergence speed depends on the eigenvalue spread of 𝐑.

A white noise signal has autocorrelation matrix 𝐑=σ2𝐈 where σ2 is the variance of the signal. In this case all eigenvalues are equal, and the eigenvalue spread is the minimum over all possible matrices. The common interpretation of this result is therefore that the LMS converges quickly for white input signals, and slowly for colored input signals, such as processes with low-pass or high-pass characteristics.

It is important to note that the above upperbound on μ only enforces stability in the mean, but the coefficients of h^(n) can still grow infinitely large, i.e. divergence of the coefficients is still possible. A more practical bound is

0<μ<2tr[𝐑],

where tr[𝐑] denotes the trace of 𝐑. This bound guarantees that the coefficients of h^(n) do not diverge (in practice, the value of μ should not be chosen close to this upper bound, since it is somewhat optimistic due to approximations and assumptions made in the derivation of the bound).

## Normalized least mean squares filter (NLMS)

The main drawback of the "pure" LMS algorithm is that it is sensitive to the scaling of its input x(n). This makes it very hard (if not impossible) to choose a learning rate μ that guarantees stability of the algorithm (Haykin 2002). The Normalised least mean squares filter (NLMS) is a variant of the LMS algorithm that solves this problem by normalising with the power of the input. The NLMS algorithm can be summarised as:

Parameters: | p= filter order

|

| μ= step size
Initialization: | 𝐡^(0)=zeros⁡(p)
Computation: | For n=0,1,2,...

𝐱(n)=[x(n),x(n−1),…,x(n−p+1)]T

| e(n)=d(n)−𝐡^H(n)𝐱(n)
| 𝐡^(n+1)=𝐡^(n)+μe*(n)𝐱(n)𝐱H(n)𝐱(n)

### Optimal learning rate

It can be shown that if there is no interference (v(n)=0), then the optimal learning rate for the NLMS algorithm is

μopt=1

and is independent of the input x(n) and the real (unknown) impulse response 𝐡(n). In the general case with interference (v(n)≠0), the optimal learning rate is

μopt=E[|y(n)−y^(n)|2]E[|e(n)|2]

The results above assume that the signals v(n) and x(n) are uncorrelated to each other, which is generally the case in practice.

### Proof

Let the filter misalignment be defined as Λ(n)=|𝐡(n)−𝐡^(n)|2, we can derive the expected misalignment for the next sample as:

E[Λ(n+1)]=E[|𝐡^(n)+μe*(n)𝐱(n)𝐱H(n)𝐱(n)−𝐡(n)|2]
E[Λ(n+1)]=E[|𝐡^(n)+μ(v*(n)+y*(n)−y^*(n))𝐱(n)𝐱H(n)𝐱(n)−𝐡(n)|2]

Let δ=𝐡^(n)−𝐡(n) and r(n)=y^(n)−y(n)

E[Λ(n+1)]=E[|δ(n)−μ(v(n)+r(n))𝐱(n)𝐱H(n)𝐱(n)|2]
E[Λ(n+1)]=E[(δ(n)−μ(v(n)+r(n))𝐱(n)𝐱H(n)𝐱(n))H(δ(n)−μ(v(n)+r(n))𝐱(n)𝐱H(n)𝐱(n))]

Assuming independence, we have:

E[Λ(n+1)]=Λ(n)+E[(μ(v(n)+r(n))𝐱(n)𝐱H(n)𝐱(n))H(μ(v(n)+r(n))𝐱(n)𝐱H(n)𝐱(n))]−2E[μ|r(n)|2𝐱H(n)𝐱(n)]
E[Λ(n+1)]=Λ(n)+μ2E[|e(n)|2]𝐱H(n)𝐱(n)−2μE[|r(n)|2]𝐱H(n)𝐱(n)

The optimal learning rate is found at dE[Λ(n+1)]dμ=0, which leads to:

2μE[|e(n)|2]−2E[|r(n)|2]=0
μ=E[|r(n)|2]E[|e(n)|2]

## See also

* Recursive least squares
* For statistical techniques relevant to LMS filter see Least squares.
* Similarities between Wiener and LMS
* Multidelay block frequency domain adaptive filter
* Zero-forcing equalizer
* Kernel adaptive filter
* Matched filter
* Wiener filter

## References

* Monson H. Hayes: Statistical Digital Signal Processing and Modeling, Wiley, 1996, ISBN 0-471-59431-8
* Simon Haykin: Adaptive Filter Theory, Prentice Hall, 2002, ISBN 0-13-048434-2
* Simon S. Haykin, Bernard Widrow (Editor): Least-Mean-Square Adaptive Filters, Wiley, 2003, ISBN 0-471-21570-8
* Bernard Widrow, Samuel D. Stearns: Adaptive Signal Processing, Prentice Hall, 1985, ISBN 0-13-004029-0
* Weifeng Liu, Jose Principe and Simon Haykin: Kernel Adaptive Filtering: A Comprehensive Introduction, John Wiley, 2010, ISBN 0-470-44753-2
* Paulo S.R. Diniz: Adaptive Filtering: Algorithms and Practical Implementation, Kluwer Academic Publishers, 1997, ISBN 0-7923-9912-9

## External links

* LMS Algorithm in Adaptive Antenna Arrays www.antenna-theory.com
* LMS Noise cancellation demo www.advsolned.com

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Least mean squares filter. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Least_mean_squares_filter&oldid=4154559"