📄 adaptivelms.m
字号:
clear
clc
>> t=0:1/10000:1-0.0001;
>> s=sin(2*pi*t);
>> n=randn(size(t));
>> x=s+n;
>> w=[0,0.5];
>> u=0.00026;
>> for i=1:9999;
y(i+1)=n(i:i+1)*w';
e(i+1)=x(i+1)-y(i+1);
w=w+2*u*e(i+1)*n(i:i+1);
end
>> figure(1)
>> subplot(3,1,1)
>> plot(t,x);
>> title('带噪信号')
>> subplot(3,1,2)
>> plot(t,s);
>> title('正弦信号')
>> subplot(3,1,3)
>> plot(t,e)
>> title('滤波结果')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -