探究可调参数对算法性能的影响
收敛因子μ
不同收敛因子取值对LMS算法性能的影响
%探究收敛因子的不同取值对LMS算法曲线的影响
clear
clc
numberOfDatapoints=1500; % 改为300会更直观
numberOfRuns=200; % 使图像更平滑
W=3.3; %特征值扩散度
NoiseVariance=0.001; % 输入噪声的方差
mu=[0.0075, 0.025, 0.075]; %LMS学习速率参数
stream = RandStream('mt19937ar','Seed',3); %
RandStream.setGlobalStream(stream); %重复生成的结果
NoiseStandardDeviation=sqrt(NoiseVariance);
u=zeros(numberOfDatapoints+14,1); % 输入数据初值
r=zeros(numberOfDatapoints+14,1); % 接收数据初值
f=zeros(numberOfDatapoints+14,1); % 误差数据初值
%预测与结果
g=zeros(numberOfDatapoints+14,1); %均方误差初值
h=[0.5*(1+cos(2*pi/W*(-1))),0.5*(1+cos(2*pi/W*(0))),0.5*(1+cos(2*pi/W*(1)))];
for m=1:size(mu,2)
for k=1:numberOfRuns % Loop for performing the appropriate number of
% Monte Carlo simulations
u=zeros(numberOfDatapoints,1); % Initialize the weights back to zero as well as the
W=zeros(11,1); % initial weights to zero
for n=3+11:numberOfDatapoints+3+11 % The loop that does the data runs and
%filter updates
u(n)=binornd(1,0.5)