📄 ls1.m
字号:
clear,close all;
N=400;
M=2;
period=[0:N-1];
x=sin(2*pi*0.02*period);
period1=[0,0:N-2];
x1=sin(2*pi*0.02*period1);
xs=0.4*x+0.4*x1;
figure;
subplot(2,1,1);
plot(xs);
grid;
title('standard singal');
noise=0.05*randn(1,N);
y=0.4*x+0.4*x1+noise;
subplot(2,1,2);
plot(y);
grid;
title('standard singal with noise ave=0.5 var=0.05');
[R,d]=lsmatvec('full',x',M,y');
cls=R\d;
Y=filter(1,cls,y);
figure;
plot(0:N-1,Y,'.',0:N-1,y,'k');
grid;
title('The predict singal vs the disired response--post');
legend('Predict singal','Desired response');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -