资源描述:
《邓俊辉信号与系统2材料》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、function[f,n]=sconv(f1,f2,n1,n2,p)f=conv(f1,f2);f=f*p;n3=n1(1)+n2(1);L=length(n1)+length(n2)-1;n=n3:p:(n3+(L-1)*p);p=0.01;n1=-1:p:1;f1=ones(1,length(n1));n2=0:p:1;f2=2*n2;[f,n]=sconv(f1,f2,n1,n2,p);subplot(3,1,1),plot(n1,f1),axis([-1.5,1.5,0,2]),gridonsubplot(3,1,2),plot(n2,f2),axis
2、([-0.1,1.2,0,3]),gridonsubplot(3,1,3),plot(n,f),axis([-1.5,5,0,2]),gridon>>x=[1,2,3,4];y=[1,1,1,1];>>z=conv(x,y)z=13610974>>N=length(z);>>stem(0:N-1,z)>>>>sys=tf([001],[12100]);>>t=0:0.01:5;>>f=10*sin(2*pi*t);>>y=lsim(sys,f,t);>>plot(t,y)>>sys=tf([001],[12100]);>>t=0:0.01:5;>>y=impu
3、lse(sys,t);>>plot(t,y)>>title('连续冲击响应')>>xlabel('time(sec)')>>ylabel('y(t)')>>sys=tf([001],[12100]);>>t=0:0.01:5;>>y=step(sys,t);>>plot(t,y)>>title('阶跃冲击响应')>>xlabel('time(sec)')>>ylabel('y(t)')>>k=0:10;a=[132];b=[100];>>h=impz(b,a,k);>>stem(k,h)>>title('单位冲击响应')>>>>sys=tf([001],[15
4、-1]);>>t=0:0.01:5;>>f=2*cos(pi*t);>>y=lsim(sys,f,t);>>plot(t,y)sys=tf([001],[1sqrt(2)1]);t=0:0.01:10;y=impulse(sys,t);subplot(3,1,1);plot(t,y)title('连续冲击响应')xlabel('time(sec)')ylabel('y(t)')sys=tf([001],[1sqrt(2)1]);t=0:0.01:10;y=step(sys,t);subplot(3,1,2);plot(t,y)title('阶跃冲击响应')xl
5、abel('time(sec)')ylabel('y(t)')sys=tf([011],[111]);t=0:0.01:10;y=impulse(sys,t);subplot(3,1,1);plot(t,y)title('连续冲击响应')xlabel('time(sec)')ylabel('y(t)')sys=tf([011],[111]);t=0:0.01:10;y=step(sys,t);subplot(3,1,2);plot(t,y)title('阶跃冲击响应')xlabel('time(sec)')ylabel('y(t)')