1、西南交大信号与系统实验报告西南交通大学信号与系统实验报告班级 _ 学号 _ 姓名 _实验时间 _ 年_ 月_ 日实验名称_预 习:操 作:报 告:总 评:指导老师:一、实验预习内容1、实验目的:2、实验内容及实验函数说明: 电气工程基础实验中心二、实验内容1.2t=-3:0.01:3;y=rectpuls(t,2);plot(t,y);axis(-5,5,-0.5,1.5);1.3t=-1:0.0001:1;y1=5*rectpuls(t,0.2);y2=10*rectpuls(t,0.1);plot(t,y1,t,y2)axis(-1,1,-1,12);1.4(1)t=-3:0.01:3;y
2、=5*cos(12*pi*t)+6*cos(18*pi*t);plot(t,y);axis(0,1,-9,11);1.4(2)syms t;y=cos(2*pi*t)*cos(2*pi*t);ezplot(y,0,1);axis(0,1,0,1);4.2t=0:0.001:6;a1=1 5 6;a2=1 2 5;a3=1 2 1;b=1 5;y1=step(b,a1,t);y2=step(b,a2,t);y3=step(b,a3,t);plot(t,y1,t,y2,+,t,y3,*);4.5a=1 5 6;b=2 8;A,B,C,D=tf2ss(b,a);sys=ss(A,B,C,D);t=0
3、:0.01:5;f=zeros(1,length(t);x0=0,-3;subplot(1,3,1);plot(t,y1);y1=lsim(sys,f,t,x0);f=exp(-t);subplot(1,3,2);plot(t,y2);y2=lsim(sys,f,t);subplot(1,3,3);plot(t,y3);y3=lsim(sys,f,t,x0);5.3Ts=0.001;t=-1:Ts:5;f=(t0)-(t1);h=0.5*(t1)-(t3);y=conv(f,h)*Ts;L=length(y);k=(0:L-1)*Ts+1;subplot(2,1,2);plot(k,y);gr
4、id on;axis(0,10,0,0.7);%6.1syms t T n;y1=4/T*t+1;y2=-4/T*t+1;a0=1/T*(int(y1,-T/2,0)+int(y2,0,T/2);y3=y1*cos(n*2*pi/T*t);y4=y2*cos(n*2*pi/T*t);an=2/T*(int(y3,-T/2,0)+int(y4,0,T/2);bn=0;an=zeros(50,1);cn=zeros(50,1);T=2*pi;an(1)=0;cn(1)=0;for(i=1:1:50)an(i+1)=-2*(-2+2*cos(i*pi)+i*pi*sin(i*pi)/i2/pi2;c
5、n(i+1)=abs(an(i+1);endsyms k;k=0:1:50;stem(k,cn);subplot(2,1,1);plot(k,cn);t=-5:0.01:5;f=sawtooth(t-pi),0.5);subplot(2,1,2);plot(t,f);1%7.3a=0.08 0.4 1;b=1;w=linspace(0,10,300);h,w=freqs(b,a,w);subplot(2,1,1);plot(w,abs(h);grid on;subplot(2,1,2);plot(w,angle(h);grid on;%7.1syms t;f=exp(-2*abs(t);sub
6、plot(3,1,1)ezplot(f);y1=fourier(f);y=abs(y1);subplot(3,1,2);ezplot(y);im=imag(y1);re=real(y1);phase=atan(im/re);subplot(3,1,3);ezplot(phase);%7.2syms tao w t;tao=1;F=(tao*sin(w*tao/2/pi)/(w*tao/2);subplot(2,2,1);ezplot(F);f=ifourier(F,t);subplot(2,2,2);ezplot(f);title(f(t);subplot(2,2,3);ezplot(abs(
7、F);title(幅度频谱);im=imag(F);re=real(F);phase=atan(im/re);subplot(2,2,4);ezplot(phase);%9.4syms s t;H=(s2+1)/(s5+2*s4-3*s3+3*s2+3*s+2);num=1 0 1;den=1 2 -3 3 3 2;sys=tf(num,den);subplot(211);pzmap(sys);subplot(212)impulse(num,den);%9.5syms s t;L=(s+5)/(s2+5*s+6);h=ilaplace(L);subplot(311);ezplot(h);F=1
8、/s;Y1=L*L;y1=ilaplace(Y1);subplot(312);ezplot(y1);f=exp(-t);F1=laplace(f);Y2=F1*L;y2=ilaplace(Y2);subplot(313);ezplot(y2);%9.6syms s t;H=1/(s2+5*s+4);f=sym(1-t)*(heaviside(t)-heaviside(t-2)-(heaviside(t-2)-heaviside(t-3);subplot(211);ezplot(f);F=laplace(f);Y=H*F;y=ilaplace(Y);subplot(212);ezplot(y);
9、%9.2(1)syms s;H=(s+1)*(s+4)/(s*(s+3)*(s+2);h=ilaplace(H);num=conv(1 1,1 4);den=conv(conv(1 0,1 2),1 3);k,p,c=residue(num,den)%9.2(2)syms s;H=(s3+5*s2+9*s+7)/(s2+3*s+2);h=ilaplace(H);num=1 5 9 7;den=1 3 2;k,p,c=residue(num,den)%10.5 N=30; a=1 0.4 -0.12; b=1 2;f=ones(1,N); k=0:1:N-1; yf=filter(b,a,f);
10、 subplot(211); stem(k,yf); zi=filtic(b,a,1,2); y=filter(b,a,f,zi); subplot(212); stem(k,y); %11.2(1) syms n; f=(-1)n; h=1/3*(-1)n+2/3*(3)n; F=ztrans(f); H=ztrans(h); Yf=H*F; yf=iztrans(Yf) n=0:0.5:10; yf=1/2*(-1).n+1/3*(-1).n.*n+1/2*3.n; stem(n,yf); %11.2(2) syms n z; f=1n; F=ztrans(f); H=z*(7*z-2)/
11、(z-0.2)*(z-0.5); Y=H*F; y=iztrans(Y) n=0:1:10; y=25/2-1/2*(1/5).n-5*(1/2).n; stem(n,y); %11.2(3) num=7 -2 0;den=conv(1 -0.7,1 0.1);r,p,k=residuez(num,den) %11.3 syms z; H=z2/(z2+sqrt(2)*z+1); hn=iztrans(H) n=0:0.1:10;hn=cos(3/4*pi*n)-sin(3/4*pi*n);subplot(211);stem(n,hn); num=1 0 0; den=1 sqrt(2) 1;
12、 a=roots(num); b=roots(den); subplot(212); zplane(a,b); %10.2n=50; a=1 -1 -2; b=1 -1; subplot(311); impz(b,a); subplot(312); impz(b,a,n); subplot(313); impz(b,a,-20:1:30); y=impz(b,a,-5:1:10) %11.1syms n a; f1=n; f2=an; f3=0.5*n*(heaviside(n)-heaviside(n-5); f4=an*cos(n*pi/2); F1=ztrans(f1) F2=ztrans(f2) F3=ztrans(f3) F4=ztrans(f4)波形部分电气工程基础实验中心三、实验分析及总结:电气工程基础实验中心