# 最小均方滤波器

最小均方（LMS）滤波器是一种自适应滤波算法，它递归地调整线性滤波器的权重，以最小化期望信号与滤波器输出之间的误差，所用的随机梯度更新不需要知道信号的统计特性。它编码简单、易于构建、对外部干扰具有鲁棒性，且计算量随可调权重数目线性增长——这正是它被称为所有自适应算法中最成功者的重要原因。<sup>[1](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)</sup><sup> • </sup><sup>[2](https://sethares.engr.wisc.edu/paperspdf/lmsfam.pdf)</sup><sup> • </sup><sup>[3](https://link.springer.com/article/10.1186/s13634-015-0291-1)</sup> 在其归一化形式下，它以百万计的规模部署于电回声补偿器、电话交换机和自适应均衡器中。<sup>[3](https://link.springer.com/article/10.1186/s13634-015-0291-1)</sup>

| 关键事实 | 数值 |
|---|---|
| 最小化的量 | 期望信号与滤波器输出之间的均方误差，逐样本用瞬时平方误差近似 <sup>[4](https://ocw.mit.edu/courses/2-161-signal-processing-continuous-and-discrete-fall-2008/d500ebd932a80d4417a1ba42fe7f5429_adaptivels.pdf)</sup> |
| 核心更新 | \( w(n+1) = w(n) + \mu\, x(n)\, e(n) \) <sup>[1](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)</sup> |
| 稳定性界（LMS） | \( 0 < \mu < 2/\lambda_{\max} \)；实用的固定步长界为 \( \mu \le 2/(3\,\mathrm{tr}[R_{uu}]) \) <sup>[5](https://uk.mathworks.com/help/dsp/ug/compare-rls-and-lms-adaptive-filter-algorithms.html)</sup><sup> • </sup><sup>[3](https://link.springer.com/article/10.1186/s13634-015-0291-1)</sup> |
| 稳定性界（NLMS） | 均方稳定要求 \( 0 < \mu < 2 \) <sup>[6](https://www.mdpi.com/2073-8994/18/4/649)</sup> |
| 每样本开销 | LMS 约 2L 次乘法；NLMS 约 3L + 1 次运算，二者均为 O(L) <sup>[7](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup><sup> • </sup><sup>[6](https://www.mdpi.com/2073-8994/18/4/649)</sup> |
| 主要弱点 | 输入分量高度相关（特征值散布大）时收敛缓慢 <sup>[8](https://course.ece.cmu.edu/~ece491/lectures/L27/AdaptiveFilteringChap_ADSP.pdf)</sup><sup> • </sup><sup>[4](https://ocw.mit.edu/courses/2-161-signal-processing-continuous-and-discrete-fall-2008/d500ebd932a80d4417a1ba42fe7f5429_adaptivels.pdf)</sup> |
| 最接近的替代方案 | 递归最小二乘（RLS）：以 \( O(L^{2}) \) 的开销换取更快的收敛和更小的稳态误差，而 LMS 为 O(L) <sup>[5](https://uk.mathworks.com/help/dsp/ug/compare-rls-and-lms-adaptive-filter-algorithms.html)</sup><sup> • </sup><sup>[9](https://gtas.unican.es/files/pub/chapter9_adaptive_kernel_learning.pdf)</sup> |

## 工作原理

该滤波器是线性的，权重为 \( w(n) \)，输入向量为 \( x(n) \)，误差 \( e(n) = d(n) - y(n) \) 相对于期望信号 \( d(n) \) 定义。理想目标是最小化均方误差，即一个具有单一极小值的二次性能曲面 \( J(n) = e^{2}(n) = (d(n) - y(n))^{2} \)。<sup>[4](https://ocw.mit.edu/courses/2-161-signal-processing-continuous-and-discrete-fall-2008/d500ebd932a80d4417a1ba42fe7f5429_adaptivels.pdf)</sup> 在该曲面上做精确的最速下降需要输入自相关矩阵 \( R = E[X_{k} \cdot X_{k}^{T}] \) 和互相关 \( P = E[d_{k} \cdot X_{k}] \)，而这些在实践中是未知的。

LMS 用瞬时值代替集合统计量：\( R \) 变为 \( X_{k} \cdot X_{k}^{T} \)，\( P \) 变为 \( d_{k} \cdot X_{k} \)，并忽略因子 \( R^{-1} \)，得到更新式 \( W_{k+1} = W_{k} + \mu\, X_{k} \cdot e_{k} \)，其中来自 \( e_{k}^{2} \) 梯度的因子二被吸收进 \( \mu \)。<sup>[8](https://course.ece.cmu.edu/~ece491/lectures/L27/AdaptiveFilteringChap_ADSP.pdf)</sup> 等价地，用瞬时平方误差的梯度来估计均方误差的梯度，得到 \( w(n+1) = w(n) + \mu\,[\,p(n) - R(n)\,w(n)\,] \)，其中采用这些瞬时估计 <sup>[10](https://web.ece.ucsb.edu/~yoga/courses/Adapt/P6_Adaptive_Filtering_LMS%20.pdf)</sup>，该式化简为 \( w(n+1) = w(n) + \mu\, x(n)\, e(n) \)。<sup>[1](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)</sup><sup> • </sup><sup>[6](https://www.mdpi.com/2073-8994/18/4/649)</sup>

由于每条系数轨迹都是对理想梯度下降轨迹的含噪近似，LMS 是一种随机梯度算法 <sup>[8](https://course.ece.cmu.edu/~ece491/lectures/L27/AdaptiveFilteringChap_ADSP.pdf)</sup>，步长 \( \mu \) 扮演学习率的角色。<sup>[11](https://www-isl.stanford.edu/~widrow/papers/j2005thinkingabout.pdf)</sup>

## 实现方法

逐样本的循环是：由当前权重计算滤波器输出，针对期望样本形成误差，再将每个权重增加 \( \mu \) 乘以误差再乘以对应输入样本所得的量。经典更新的开销约为每样本 2L 次乘法。<sup>[7](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup>

**步长选择**是主要的设计决策。经典 LMS 的稳定性要求 \( 0 < \mu < 2/\lambda_{\max} \)，其中 \( \lambda_{\max} \) 是输入自相关矩阵的最大特征值。<sup>[5](https://uk.mathworks.com/help/dsp/ug/compare-rls-and-lms-adaptive-filter-algorithms.html)</sup> 固定步长的一个实用界为 \( \mu_{\text{classic}} \le 2/(3\,\mathrm{tr}[R_{uu}]) \)。<sup>[3](https://link.springer.com/article/10.1186/s13634-015-0291-1)</sup> 步长过小则收敛极慢；步长过大则收敛快，但系统可能无法稳定在最小误差值上。<sup>[5](https://uk.mathworks.com/help/dsp/ug/compare-rls-and-lms-adaptive-filter-algorithms.html)</sup> 常见的解决办法是用估计的输入功率对步长做归一化，由此产生下面的 NLMS 变体。<sup>[12](https://journals.pan.pl/Content/101569/PDF/05_paper.pdf?handler=pdf)</sup>

## 起源

已发表的资料对该算法的提出时间说法不一：一份课程教材将其归于 20 世纪 70 年代 <sup>[8](https://course.ece.cmu.edu/~ece491/lectures/L27/AdaptiveFilteringChap_ADSP.pdf)</sup>，而其他记述给出的是 1960 年。<sup>[1](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)</sup><sup> • </sup><sup>[9](https://gtas.unican.es/files/pub/chapter9_adaptive_kernel_learning.pdf)</sup> 该算法最初没有名称，\( \mu \) 被称为学习率。

## 变体

LMS 家族构成一个谱系，所有成员都是某一共同更新形式的特例：最小二乘引出 LMS，LMS 引出归一化 LMS，归一化 LMS 引出泄漏最小均方，泄漏最小均方引出符号与量化变体。<sup>[2](https://sethares.engr.wisc.edu/paperspdf/lmsfam.pdf)</sup>

**归一化 LMS（NLMS）** 将更新除以输入能量，从而消除收敛性和稳定性对信号功率的依赖：\( w_{\mathrm{NLMS}}(k+1) = w_{\mathrm{NLMS}}(k) + \frac{\mu}{\alpha + u_{k}^{T} \cdot u_{k}}\, u_{k}\,(d_{k} - u_{k}^{T} \cdot w_{\mathrm{NLMS}}(k)) \)，其中 \( \alpha \) 是一个小的正则化常数。<sup>[7](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup> 当 \( 0 < \mu < 2 \) 时均方稳定性有保证 <sup>[6](https://www.mdpi.com/2073-8994/18/4/649)</sup>，而归一化使每次更新的开销约为 3L 次乘法，而非约 2L 次。<sup>[7](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup>

**符号与量化变体** 将乘积中的一个或两个因子替换为其符号（符号-数据、符号-误差和符号-符号最小均方都是软件库中的标准选项）。<sup>[13](https://www.mathworks.com/help/dsp/ref/dsp.lmsfilter-system-object.html)</sup> 其中许多变体实际上并不最小化最小均方误差：符号-误差变体倾向于最小化误差的绝对值。<sup>[2](https://sethares.engr.wisc.edu/paperspdf/lmsfam.pdf)</sup>

**频域（变换域）LMS** 在频域中执行自适应。频域自适应滤波器（FDAF）及其分块形式，每 L 个输出样本的一块约需五次大小为 2L 的（I）FFT，即每输出样本 O(log L) 次乘法而非 O(L)。<sup>[7](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup> 代价是约 \( 2L_{\mathrm{B}} \) 个样本的延迟，这促使人们开发用于声学回声消除的多相替代方案。<sup>[7](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)</sup>

**仿射投影（AP）** 通过将过去 \( P \) 个回归方向纳入考虑，相对于普通梯度方法加快了收敛，快速的 AP 变体运行在数以百万计的电回声消除设备中。<sup>[14](https://link.springer.com/article/10.1186/s13634-015-0289-8)</sup>

近期的工作是在扩展这一家族，而非取代它。一种神经网络辅助的可变步长 NLMS（NN-VSS-NLMS）相比经典 NLMS，收敛速度最高提高到原来的四倍，稳态误差降低 8 dB 以上。<sup>[6](https://www.mdpi.com/2073-8994/18/4/649)</sup> 一类新的自归一化 LMS 算法自动选择其归一化项，在级联滤波器场景中稳态性能优于既有方案，而收敛速度同样快。<sup>[15](https://digital-library.theiet.org/doi/10.1049/ell2.12498)</sup> KLMS-Net 将核最小均方算法的迭代过程转化为深度神经网络的前向传播，以模型驱动的方式学习隐式特征映射。<sup>[16](https://digital-library.theiet.org/doi/full/10.1049/ell2.70125)</sup>

## 应用

在自适应波束成形、自适应信道均衡、数字助听器中的声反馈抑制、主动噪声控制和声学回声消除（后者在手机中已是常规配置）中，LMS 是相对于 RLS 的常见选择；原因是简单、计算速度快和鲁棒性强。<sup>[12](https://journals.pan.pl/Content/101569/PDF/05_paper.pdf?handler=pdf)</sup> 在大规模部署中，NLMS 以百万计的规模出现于电回声补偿器、电话交换机和自适应均衡器中。<sup>[3](https://link.springer.com/article/10.1186/s13634-015-0291-1)</sup>

## 局限与替代方案

**失调。** 一条由来已久的经验法则是：失调量等于权重数除以建立时间；一般而言，当自适应建立时间等于自适应横向滤波器记忆时间跨度的十倍时，可实现 10% 的失调。<sup>[17](https://isl.stanford.edu/~widrow/papers/j1976stationaryand.pdf)</sup>

**收敛与失效模式。** 收敛速度取决于输入自相关矩阵的特征值比 \( \lambda_{\min}/\lambda_{\max} \)：接近 1 时收敛快，而远低于 1 时收敛迟缓、跟踪能力差。<sup>[4](https://ocw.mit.edu/courses/2-161-signal-processing-continuous-and-discrete-fall-2008/d500ebd932a80d4417a1ba42fe7f5429_adaptivels.pdf)</sup> 因此，当观测向量的各分量高度相关时，LMS 可能收敛缓慢。<sup>[8](https://course.ece.cmu.edu/~ece491/lectures/L27/AdaptiveFilteringChap_ADSP.pdf)</sup> 权重更新 \( \Delta w = \eta_{k}\,x_{k}\,e_{k} \) 与输入信号向量方向相同，这使 LMS 对数据中的离群值和噪声敏感。<sup>[18](https://www.commsp.ee.ic.ac.uk/~mandic/LMS_Kalman_IEEE_SPM_2015.pdf)</sup> 不稳定性也可能出现在变体中：带步长控制的伪仿射投影可能因输入统计特性而变得不稳定，且存在这样的情况——即使很小的步长也不能产生稳定行为，反而需要更大的步长。<sup>[14](https://link.springer.com/article/10.1186/s13634-015-0289-8)</sup>

**与 RLS 的比较。** 递归最小二乘从记录起点开始最小化总的加权平方误差，使用遗忘因子 \( \lambda \in (0, 1] \)；而 LMS 仅根据当前误差自适应，对较早的误差没有记忆。<sup>[5](https://uk.mathworks.com/help/dsp/ug/compare-rls-and-lms-adaptive-filter-algorithms.html)</sup> RLS 以更多计算为代价提供更快的收敛和更小的稳态误差 <sup>[5](https://uk.mathworks.com/help/dsp/ug/compare-rls-and-lms-adaptive-filter-algorithms.html)</sup>：其每步复杂度是二次的 \( O(L^{2}) \)，而 LMS 是线性的 O(L)。<sup>[9](https://gtas.unican.es/files/pub/chapter9_adaptive_kernel_learning.pdf)</sup> 在平稳场景中，RLS 在均值和方差意义上收敛到维纳解，优于 LMS 缓慢的自适应速率。<sup>[9](https://gtas.unican.es/files/pub/chapter9_adaptive_kernel_learning.pdf)</sup>

## References

1. [The Least-Mean-Square Algorithm (Haykin, textbook chapter)](https://users.ece.utexas.edu/~vtelang/ece351m/ReadingAssignments/LMShaykin.pdf)
2. [The LMS family of adaptive algorithms (William Sethares, book chapter)](https://sethares.engr.wisc.edu/paperspdf/lmsfam.pdf)
3. [Asymptotic equivalent analysis of the LMS algorithm under linearly filtered processes (EURASIP Journal on Advances in Signal Processing)](https://link.springer.com/article/10.1186/s13634-015-0291-1)
4. [Adaptive Filters, 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)
5. [Compare RLS and LMS Adaptive Filter Algorithms, MathWorks documentation](https://uk.mathworks.com/help/dsp/ug/compare-rls-and-lms-adaptive-filter-algorithms.html)
6. [A Neural Network-Assisted Variable Step-Size NLMS Algorithm (MDPI Symmetry)](https://www.mdpi.com/2073-8994/18/4/649)
7. [Chapter 8: LMS Algorithms (KU Leuven course notes)](https://homes.esat.kuleuven.be/~dspuser/DSP-CIS/2022-2023/material/chapter8-LMS%20Algorithms-pp40.pdf)
8. [Adaptive Filtering chapter (CMU ECE 491 lecture text)](https://course.ece.cmu.edu/~ece491/lectures/L27/AdaptiveFilteringChap_ADSP.pdf)
9. [Adaptive Kernel Learning for Signal Processing (Chapter 9)](https://gtas.unican.es/files/pub/chapter9_adaptive_kernel_learning.pdf)
10. [Linear FIR Adaptive Filtering (II): Stochastic Gradient-based Algorithms (LMS), UCSB course notes](https://web.ece.ucsb.edu/~yoga/courses/Adapt/P6_Adaptive_Filtering_LMS%20.pdf)
11. [Thinking about Thinking: The Discovery of the LMS Algorithm (IEEE Signal Processing Magazine)](https://www-isl.stanford.edu/~widrow/papers/j2005thinkingabout.pdf)
12. [LMS Algorithm Step Size Adjustment for Fast Convergence (journal paper)](https://journals.pan.pl/Content/101569/PDF/05_paper.pdf?handler=pdf)
13. [dsp.LMSFilter, MATLAB documentation](https://www.mathworks.com/help/dsp/ref/dsp.lmsfilter-system-object.html)
14. [Adaptive filters: stable but divergent (Springer)](https://link.springer.com/article/10.1186/s13634-015-0289-8)
15. [A new class of self-normalising LMS algorithms (Electronics Letters, IET)](https://digital-library.theiet.org/doi/10.1049/ell2.12498)
16. [KLMS-Net: Deep unrolling for kernel least mean square algorithm (Electronics Letters, IET)](https://digital-library.theiet.org/doi/full/10.1049/ell2.70125)
17. [Stationary and Nonstationary Learning Characteristics of the LMS Adaptive Filter (Widrow et al., 1976)](https://isl.stanford.edu/~widrow/papers/j1976stationaryand.pdf)
18. [LMS and Kalman (IEEE Signal Processing Magazine, 2015)](https://www.commsp.ee.ic.ac.uk/~mandic/LMS_Kalman_IEEE_SPM_2015.pdf)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 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-filter

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