%离散时间信号的表示
clear all;close all;clc;
n=-8:8;
x=0.8.^n;
subplot(1,2,1),stem(n,x,'.');
xlabel('n');ylabel('x(n)');title('线图');axis([-10 10 -0.5 6.5]);
subplot(1,2,2),plot(n,x);
xlabel('n');ylabel('x(n)');title('包络图');axis([-10 10 -0.5 6.5]);
line([-10,10],[0,0]);
set(gcf,'color','w')

%单位冲激序列
close all;clc;
n=0:15;
x1=[1 zeros(1,15)];
x2=[(n-5)==0];
subplot(1,2,1),stem(n,x1);
grid;xlabel('n');ylabel('x1');title('delta(n)线图');
axis([-1 16 -0.1 1.1]);line([-1 16],[0,0]);
subplot(1,2,2),stem(n,x2);
grid;xlabel('n');ylabel('x2');title('delta(n-5)线图');
axis([-1 16 -0.1 1.1]);line([-1 16],[0,0]);
set(gcf,'color','w');

%单位阶跃序列
close all;clc;
n=-5:15;
x1=[zeros(1,5),ones(1,16)];
x2=[(n-5)>=0];
subplot(1,2,1),stem(n,x1);
grid;xlabel('n');ylabel('x1');title('u(n)线图');
axis([-6