# 最小均方算法

最小均方（LMS）算法是一种自适应滤波方法，它在每个样本之后调整线性滤波器的权重，利用随机梯度步来最小化期望信号与滤波器输出之间的均方误差。它是一种广泛使用的自适应滤波方法，用于预测、系统辨识、噪声抵消和信道均衡。<sup>[1](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)</sup> 其基本构件是自适应线性组合器，被描述为所有神经网络以及信号处理与控制中所有[自适应滤波器](https://www.edgepedia.org/zh/adaptive-filter)的基本单元；LMS则是调整其权重的规则。<sup>[2](https://link.springer.com/chapter/10.1007/978-3-031-80939-2_3)</sup> 它的吸引力在于简单：不需要知道输入统计量，且其计算代价仅随权重数目线性增长。<sup>[1](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)</sup>

| 关键事实 | 数值 |
|---|---|
| 更新规则 | \( \hat{w}(n+1) = \hat{w}(n) + \mu \cdot x(n) \cdot e(n) \)，一个随机梯度步<sup>[1](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)</sup> |
| 稳定界 | 充分条件 \( 0 < \mu < 1/\mathrm{tr}(R) \)；也表述为 \( 0 < \mu < 2/\lambda_{\max} \)<sup>[3](https://isl.stanford.edu/~widrow/papers/j1976stationaryand.pdf)</sup><sup> • </sup><sup>[4](https://www.mathworks.com/help/dsp/ug/compare-rls-and-lms-adaptive-filter-algorithms.html)</sup> |
| 失调（梯度噪声） | \( M = \mu\, \mathrm{tr}(R) \)，在 \( M \le 25\% \) 时可靠<sup>[3](https://isl.stanford.edu/~widrow/papers/j1976stationaryand.pdf)</sup> |
| 复杂度 | 对于 \( N \) 权重的滤波器，每次迭代约 \( 2N \) 次运算，而递归最小二乘（RLS）快速卡尔曼为 \( 10N+1 \)<sup>[5](http://udrc.eng.ed.ac.uk/sites/udrc.eng.ed.ac.uk/files/publications/optimal_adaptive_filtering-muney-1_2.pdf)</sup> |
| 最常用的变体 | 归一化LMS，步长为 \( \mu/(\alpha + u_k^{T} \cdot u_k) \)<sup>[6](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup> |
| 起源 | 威德罗（Widrow）与霍夫（Hoff），《自适应开关电路》，IRE WESCON会议记录，第4卷，第96–104页，1960年<sup>[7](https://doi.org/10.21236/ad0241531)</sup> |
| 商业应用广度 | NLMS“以百万计”出现在回声补偿器、电话交换机和自适应均衡器中<sup>[8](https://link.springer.com/article/10.1186/s13634-015-0291-1)</sup> |

## 工作原理

LMS解决的是在不测量环境统计量的情况下，使线性滤波器匹配未知或变化环境的问题。对于平稳输入，最优固定解是[维纳滤波器](https://www.edgepedia.org/zh/wiener-filter)，\( w_{\mathrm{opt}} = R^{-1} \cdot P \)，但计算它需要输入自相关矩阵 \( R \) 和互相关 \( P \)，这些在未知环境中无法获得；这正是自适应滤波的动机所在。<sup>[1](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)</sup>

均方误差是权重的二次函数，是一个碗状曲面，其底部为维纳解。经典的最速下降法会沿此碗下降，但每个梯度步都需要完整的统计量。LMS则用瞬时估计代替真实梯度：当前误差 \( e(n) \) 与当前输入向量 \( x(n) \) 的乘积，再乘以步长 \( \mu \)。<sup>[9](https://www-isl.stanford.edu/~widrow/papers/j2005thinkingabout.pdf)</sup><sup> • </sup><sup>[2](https://link.springer.com/chapter/10.1007/978-3-031-80939-2_3)</sup> 由于梯度估计含有噪声，随着迭代进行，权重向量在维纳解附近做随机游走，而不是精确地稳定下来。<sup>[1](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)</sup>

步长 \( \mu \) 控制着这种权衡。其倒数可作为算法记忆的度量：小的 \( \mu \) 给出更长的记忆、更精确的稳态性能和更慢的收敛。<sup>[1](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)</sup> 已发表的稳定条件形式各异。威德罗（Widrow）、麦库尔（McCool）、拉里莫尔（Larimore）和约翰逊（Johnson）给出充分条件 \( 0 < \mu < 1/\mathrm{tr}(R) \)，其中 \( \mathrm{tr}(R) \) 是权重处的总输入功率。<sup>[3](https://isl.stanford.edu/~widrow/papers/j1976stationaryand.pdf)</sup> 其他处理给出权重向量均值收敛的条件，对 \( R \) 的每个特征值 \( \lambda_k \)，\( 0 < \mu < 2/\lambda_k \)，常写作 \( 0 < \mu < 2/\lambda_{\max} \)；这是在独立性类假设下的均值收敛界，而非一般稳定性保证。<sup>[10](https://ocw.mit.edu/courses/2-161-signal-processing-continuous-and-discrete-fall-2008/d500ebd932a80d4417a1ba42fe7f5429_adaptivels.pdf)</sup><sup> • </sup><sup>[4](https://www.mathworks.com/help/dsp/ug/compare-rls-and-lms-adaptive-filter-algorithms.html)</sup>

## 实现方法

实践者按照标准教程所述运行以下循环：<sup>[5](http://udrc.eng.ed.ac.uk/sites/udrc.eng.ed.ac.uk/files/publications/optimal_adaptive_filtering-muney-1_2.pdf)</sup>

1. 选择滤波器长度 \( N \) 和步长 \( \mu \)（在实例中实用范围为 \( 0 < \mu < 1 \)）。
2. 将权重向量初始化为零，\( h(0) = 0 \)。
3. 对每个样本 \( n \)：计算滤波器输出，形成相对于期望信号的误差 \( e(n) \)，并通过上述更新规则的随机梯度步更新权重。

对于普通LMS，每次时间更新的代价约为 \( 2N \) 次乘法，归一化LMS约为 \( 3L \) 次，因此该方法可以低成本地实时运行。<sup>[5](http://udrc.eng.ed.ac.uk/sites/udrc.eng.ed.ac.uk/files/publications/optimal_adaptive_filtering-muney-1_2.pdf)</sup><sup> • </sup><sup>[6](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup>

## 起源

该算法与B. 威德罗（B. Widrow）和M. E. 霍夫（M. E. Hoff）的论文《自适应开关电路》相关，发表于IRE WESCON会议记录第4卷，第96–104页，1960年。<sup>[7](https://doi.org/10.21236/ad0241531)</sup><sup> • </sup><sup>[2](https://link.springer.com/chapter/10.1007/978-3-031-80939-2_3)</sup> 它源自[ADALINE](https://www.edgepedia.org/zh/adaline)元件，该元件计算输入模式的加权和，将其与期望输出比较以产生瞬时误差，并从这些误差中获得梯度估计。<sup>[9](https://www-isl.stanford.edu/~widrow/papers/j2005thinkingabout.pdf)</sup> 海金（Haykin）将其描述为第一个线性自适应滤波算法。<sup>[1](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)</sup> 包括步长选择准则在内的自适应统计理论，由威德罗（Widrow）及其合作者在后续工作中开创。<sup>[11](https://sethares.engr.wisc.edu/paperspdf/lmsfam.pdf)</sup>

## 变体

LMS家族共享一种递归形式：参数更新 = 前次更新 + 步长 × 回归量的函数 × 误差的函数，只是这些函数的选择不同。<sup>[11](https://sethares.engr.wisc.edu/paperspdf/lmsfam.pdf)</sup>

**归一化LMS（NLMS）。** 步长除以一个与输入功率成比例的项，\( \mu/(\alpha + u_k^{T} \cdot u_k) \)，其中 \( \alpha \) 为小常数，使更新与信号功率无关且更易于调整；它被描述为实践中主要使用的变体。<sup>[6](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup> 该算法由南云（Nagumo）和野田（Noda）于1967年在《IEEE自动控制汇刊》上报道，作为一种用于系统辨识的学习方法，更新为 \( w_{k+1} = w_k + \mu e_k x_k / \|x_k\|^2 \)。<sup>[12](https://doi.org/10.1109/tac.1967.1098599)</sup><sup> • </sup><sup>[13](https://www.sciencedirect.com/science/article/abs/pii/S0165168403000446)</sup> 对于归一化方法的收敛，步长必须大于0且小于2。<sup>[14](https://www.mathworks.com/help/dsp/ref/dsp.lmsfilter-system-object.html)</sup>

**基于符号的变体。** 用误差、输入或两者的符号代替它们，得到符号-误差、符号-数据和符号-符号LMS；在符号-符号形式 \( b(n+1) = b(n) + \Lambda\, \mathrm{sgn}(e(n))\, \mathrm{sgn}(f(n)) \) 中，乘法被完全消除。MATLAB的dsp.LMSFilter将所有这些实现为降低复杂度的选项。<sup>[10](https://ocw.mit.edu/courses/2-161-signal-processing-continuous-and-discrete-fall-2008/d500ebd932a80d4417a1ba42fe7f5429_adaptivels.pdf)</sup><sup> • </sup><sup>[14](https://www.mathworks.com/help/dsp/ref/dsp.lmsfilter-system-object.html)</sup> 许多家族成员实际上并不最小化均方误差：符号-误差变体倾向于最小化误差的绝对值，而泄漏则最小化均方误差与偏离标称参数值的平方偏差的组合。<sup>[11](https://sethares.engr.wisc.edu/paperspdf/lmsfam.pdf)</sup>

**变步长LMS。** 由于固定 \( \mu \) 在稳态失调与自适应速度之间权衡，变步长方法对 \( \mu \) 本身进行自适应调整。<sup>[15](https://iiav.org/ijav/content/volumes/21_2016_590031458046128/vol_1/835_fullpaper_1207561458214850.pdf)</sup>

**块与频域形式。** 块LMS在一组样本上平均梯度估计；频域FDAF功能等价但更廉价，每块需要约五次大小为 \( 2L \) 的FFT。<sup>[6](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup>

## 应用

在其归一化版本中，LMS“以百万计”出现在电回声补偿器、电话交换机和自适应均衡器中；来源指出，没有其他自适应算法能如此成功地进入商业产品。<sup>[8](https://link.springer.com/article/10.1186/s13634-015-0291-1)</sup> 频域和多相变体用于商业声学回声消除器。<sup>[6](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup> 自适应LMS滤波器还用于实时系统辨识，其中收敛的系数估计未知系统的冲激响应，以及用于自适应谱线增强。<sup>[10](https://ocw.mit.edu/courses/2-161-signal-processing-continuous-and-discrete-fall-2008/d500ebd932a80d4417a1ba42fe7f5429_adaptivels.pdf)</sup> 无线信道均衡是一个典型应用：蜂窝基站发送已知测试信号，使手机能够低成本地学习信道参数。<sup>[16](https://nowak.ece.wisc.edu/ece830/ece830_spring13_adaptive_filtering.pdf)</sup>

## 局限与替代方案

**特征值散布。** 收敛速度由输入自相关矩阵的特征值散布决定：最慢模式以速率 \( (1 - \mu \cdot \lambda_{\min}) \) 收敛，因此特征值散布大的有色输入收敛非常慢，而白输入有 \( \lambda_{\min} = \lambda_{\max} \)。<sup>[6](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup> 当特征值差异较大时，失调主要由最快模式决定，而稳定时间受最慢模式限制；牛顿法变体通过用 \( R^{-1} \) 的估计预乘梯度估计来消除这种依赖。<sup>[3](https://isl.stanford.edu/~widrow/papers/j1976stationaryand.pdf)</sup>

**梯度噪声与跟踪。** 在非平稳跟踪中，会出现滞后失调，它与权重数目成正比，与自适应速度成反比；通过均衡梯度噪声和滞后贡献来最小化总失调。<sup>[3](https://isl.stanford.edu/~widrow/papers/j1976stationaryand.pdf)</sup> 一个理论极限：在固定常数步长下，梯度噪声通常阻止精确收敛到维纳解；然而，对于足够小的常数步长，算法是均方稳定的，并收敛到有界的稳态误差分布，而精确的随机逼近收敛需要步长趋于零。<sup>[15](https://iiav.org/ijav/content/volumes/21_2016_590031458046128/vol_1/835_fullpaper_1207561458214850.pdf)</sup>

**与RLS的比较。** RLS比LMS提供更快的收敛和更小的稳态误差，代价是二次 \( O(L^2) \) 复杂度而非LMS的线性 \( O(L) \)；在自适应滤波应用中，RLS接近[卡尔曼滤波](https://www.edgepedia.org/zh/kalman-filter)器。<sup>[17](https://gtas.unican.es/files/pub/chapter9_adaptive_kernel_learning.pdf)</sup><sup> • </sup><sup>[4](https://www.mathworks.com/help/dsp/ug/compare-rls-and-lms-adaptive-filter-algorithms.html)</sup> 然而，LMS能很好地处理非平稳场景，因为其瞬时更新会遗忘旧数据，而RLS需要遗忘因子来自适应。<sup>[17](https://gtas.unican.es/files/pub/chapter9_adaptive_kernel_learning.pdf)</sup> 在最坏情况鲁棒性方面，排序反转：哈西比（Hassibi）、赛义德（Sayed）和凯拉思（Kailath）表明，在某些步长条件下，LMS的最小可能能量增益 \( \gamma \) 为1，而RLS的扰动到误差映射的最大奇异值超过1；RLS平均而言可能表现更好。<sup>[18](https://dsp-book.narod.ru/DSPMW/20.PDF)</sup> L. 戴维森（L. Davisson）于1970年在《IEEE信息论汇刊》上发表了一项在不同假设下的相关稳态分析。<sup>[19](https://doi.org/10.1109/tit.1970.1054474)</sup>

## References

1. [The Least-Mean-Square Algorithm (Haykin, Adaptive Filter Theory / Neural Networks chapter)](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)
2. [The LMS Algorithm (Widrow & Katz, Cognitive Memory, Springer 2025)](https://link.springer.com/chapter/10.1007/978-3-031-80939-2_3)
3. [Stationary and Nonstationary Learning Characteristics of the LMS Adaptive Filter (Widrow, McCool, Larimore, Johnson; Proceedings of the IEEE, 1976)](https://isl.stanford.edu/~widrow/papers/j1976stationaryand.pdf)
4. [Compare RLS and LMS Adaptive Filter Algorithms (MathWorks documentation)](https://www.mathworks.com/help/dsp/ug/compare-rls-and-lms-adaptive-filter-algorithms.html)
5. [Adaptive Filtering: Least Mean Square and Recursive Least Squares (University of Edinburgh / UDRC tutorial)](http://udrc.eng.ed.ac.uk/sites/udrc.eng.ed.ac.uk/files/publications/optimal_adaptive_filtering-muney-1_2.pdf)
6. [DSP-CIS Chapter 8: Least Mean Squares (LMS) Algorithms, KU Leuven course notes](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)
7. [B. WIDROW, M. E. HOFF (1960). ADAPTIVE SWITCHING CIRCUITS. .](https://doi.org/10.21236/ad0241531)
8. [Asymptotic equivalent analysis of the LMS algorithm under linearly filtered processes (EURASIP Journal on Advances in Signal Processing, 2015)](https://link.springer.com/article/10.1186/s13634-015-0291-1)
9. [Thinking about thinking: the discovery of the LMS algorithm, IEEE Signal Processing Magazine](https://www-isl.stanford.edu/~widrow/papers/j2005thinkingabout.pdf)
10. [Adaptive FIR Filters / LMS, MIT OCW 2.161 Signal Processing lecture notes](https://ocw.mit.edu/courses/2-161-signal-processing-continuous-and-discrete-fall-2008/d500ebd932a80d4417a1ba42fe7f5429_adaptivels.pdf)
11. [The Least Mean Square Family (W. A. Sethares, in Adaptive System Identification and Signal Processing Algorithms, Prentice Hall)](https://sethares.engr.wisc.edu/paperspdf/lmsfam.pdf)
12. [J. Nagumo, A. Noda (1967). A learning method for system identification. IEEE Transactions on Automatic Control.](https://doi.org/10.1109/tac.1967.1098599)
13. [Convergence and steady-state analysis of a variable step-size NLMS algorithm (Signal Processing, Elsevier)](https://www.sciencedirect.com/science/article/abs/pii/S0165168403000446)
14. [dsp.LMSFilter, MATLAB documentation](https://www.mathworks.com/help/dsp/ref/dsp.lmsfilter-system-object.html)
15. [A survey of variable step-size LMS algorithms (International Journal of Acoustics and Vibration, 2016)](https://iiav.org/ijav/content/volumes/21_2016_590031458046128/vol_1/835_fullpaper_1207561458214850.pdf)
16. [Adaptive Filtering lecture notes (ECE 830, UW–Madison)](https://nowak.ece.wisc.edu/ece830/ece830_spring13_adaptive_filtering.pdf)
17. [Adaptive Kernel Learning for Signal Processing (book chapter)](https://gtas.unican.es/files/pub/chapter9_adaptive_kernel_learning.pdf)
18. [Robustness Issues in Adaptive Filtering (Sayed/Kailath chapter, CRC Press 1999)](https://dsp-book.narod.ru/DSPMW/20.PDF)
19. [L. Davisson (1970). Steady-state error in adaptive mean-square minimization. IEEE Transactions on Information Theory.](https://doi.org/10.1109/tit.1970.1054474)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026; Oct 25, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods › Numerical, string, and geometric algorithms

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/least-mean-squares-algorithm

English original: https://www.edgepedia.org/least-mean-squares-algorithm
