3、宽度为,幅度为的矩形脉冲,即t=t1处的冲击信号为8画出,t1=1的单位冲击信号。t=0:0.01:2;f=sym('5*(Heaviside(t-1)-Heaviside(t-1.2))');ezplot(f,t)2、典型离散信号的表示(单位样值序列、单位阶跃序列、实指数序列、正弦序列、复指数序列)编写函数或程序来产生下列基本脉冲序列:a.单位脉冲序列,起点n0,终点nf,在ns处有一单位脉冲。代码:n0=0;nf=10;ns=4;n1=n0:nf;x1=[zeros(1,ns-n0),1,zeros(1,nf-ns)];stem(n1,x1);
4、8b.单位阶跃序列,起点n0,终点nf,在ns前为0,在ns后为1。代码:n0=0;nf=10;ns=4;n1=n0:nf;x1=[zeros(1,ns-n0),ones(1,nf-ns+1)];stem(n1,x1);c.画出教材P21图1-26,即当a=1.2,0.6,-1.5,-0.8的单边指数序列。代码:N=30;n=1:N-1;x=1.2.^n;stem(n,x)8d.画出教材P21图1-27,即的正弦序列。N=30;a=pi/7;n=0:N-1;x=sin(a*n);stem(n,x)e.画出复指数序列和的实部和虚部。N=30;N=30
5、;a=pi/6;a=pi/6;n=0:N-1;n=0:N-1;x1=cos(a*n);x1=sin(a*n);stem(n,x1);ylabel('实部');stem(n,x1);ylabel('虚部');8将a改为3即可3、信号的自变量变换利用符号函数subs画出教材P10图1-13(a)(b)(c)(d),即f(t),f(t+5),f(-t+5),f(-2t+5)的图形。>>t=-7:0.01:7;>>symst;>>f=heaviside(t)-heaviside(t-2)+(1+t).*(heaviside(t+1)-heaviside(t
6、));>>subplot(2,2,1);ezplot(f,[-2,3]);axis([-23-0.21.2]);title('f(t)');holdon;grid;>>f1=subs(f,t,t+5);>>subplot(2,2,2);ezplot(f1,[-7,-2]);axis([-7-2-0.21.2]);title('f(t+5)');holdon;grid;>>f2=subs(f,t,-t+5);>>subplot(2,2,3);ezplot(f2,[2,7]);axis([27-0.21.2]);title('f(-t+5)');hol
7、don;grid;>>f3=subs(f,t,-2*t+5);>>subplot(2,2,4);ezplot(f3,[-1,4]);axis([-14-0.21.2]);title('f(-2t+5)');holdon;grid;88