N = 101; %设置序列长度为101
n = -50:50; %定义n值
%生成各序列数值
un = [zeros(1,50) ones(1,51)];
dn = [zeros(1,50) 1 zeros(1,50)];
rn = [zeros(1,50) ones(1,10) zeros(1,41)];
%画图
subplot(311);
stem(n,un);
title('单位阶跃序列');
subplot(312);
stem(n,dn);
title('单位脉冲序列');
subplot(313);
stem(n,rn);
title('矩形序列');


因果序列:一个右边序列,当n

一个左边序列,当n>N2时,y[n]=0;,当n
将h[0]=0(n<0)的序列称为因果序列,不满足的为非因果序列

一个单输入单输出离散时间系统在输入序列上按照规定的规则运行,并发展出输出序列,使其具有更理想的性质。

n = 0:9; %定义序列长度
a = [1 2 3 4 5 5 4 3 2 1];
b = [1 1 4 4 6 6 8 8 9 10];
%画图
subplot(311);
stem(n,a);title('a序列');
subplot(312);
stem(n,b);title('b序列');
subplot(313);
stem(n,a.*b);title('操作');


n = 0:9; %定义序列长度
a = [1 2 3 4 5 5 4 3 2 1];
b = [1 1 4 4 6 6 8 8 9 10];
%画图
subplot(311);
stem(n,a);title('a序列');
subplot(312);
stem(n,b);title('b序列');
subplot(313);
stem(n,a+b);title('操作');


n = 0:9; %定义序列长度
a = [1 2 3 4 5 5 4 3 2 1];
b = [1 1 4 4 6 6 8 8 9 10];
%画图
subplot(311);
stem(n,a);title('a序列');
%subplot(312);
%stem(n,b);title('b序列');
subplot(313);
stem(n,4*a);title('操作');


n = 0:9; %定义序列长度
a = [1 2 3 4 5 5 4 3 2 1];
b = [1 1 4 4 6 6 8 8 9 10];
%画图
subplot(311);
stem(n,a);title('a序列');
%subplot(312);
%stem(n,b);title('b序列');
subplot(313);
stem(n+1,a);title('操作');


n = 0:9; %定义序列长度
a = [1 2 3 4 5 5 4 3 2 1];
b = [1 1 4 4 6 6 8 8 9 10];
%画图
subplot(311);
stem(n,a);title('a序列');
%subplot(312);
%stem(n,b);title('b序列');
subplot(313);
stem(n-1,a);title('操作');

n = 0:9; %定义序列长度
a = [1 2 3 4 5 5 4 3 2 1];
b = [1 1 4 4 6 6 8 8 9 10];
%画图
subplot(311);
stem(n,a);title('a序列');
%subplot(312);
%stem(n,b);title('b序列');
subplot(313);
stem(-n,a);title('操作');

N = 100; %定义序列长度
n = 0:N-1;
s = 2*n.*(0.9.^n); %生成无损信号
d = rand(N,1)-0.5; %生成噪声
x = s + d';
figure(1);
stem(n,x);title('singal+noise');
pause
for m = 1:100;
d = rand(N,1)-0.5;
x1 = s + d';
x = x + x1;
end
x = x/100;
figure(2);
stem(n,d);title('noise');
figure(3);
stem(n,s);title('signal');
figure(4);
stem(n,x);title('result');
噪声信号

无损信号

混合噪声的信号

去噪后的信号
