adaptivelms.m

来自「这里的7个源代码都是关于自适应噪声滤除技术的」· M 代码 · 共 24 行

M
24
字号
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 + =
减小字号Ctrl + -
显示快捷键?