LMS算法是自适应信号处理中最常见的算法之一,Least Mean Square最小均方算法是自适应系统最常见的算法,利用Eigen库的线性代数便利计算,得到最小均方误差MSE,程序如下
/*The example of LMS algorithm for Adaptive Filtering
*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.
*The basic idea behind LMS filter is to approach the optimum filter
*weights {\displaystyle (R^{-1}P)} (R^{-1}P), 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