信号matlab实验程序.docx
《信号matlab实验程序.docx》由会员分享,可在线阅读,更多相关《信号matlab实验程序.docx(13页珍藏版)》请在冰豆网上搜索。
![信号matlab实验程序.docx](https://file1.bdocx.com/fileroot1/2022-11/28/3ba01e9e-998c-42da-8157-f20307df998f/3ba01e9e-998c-42da-8157-f20307df998f1.gif)
信号matlab实验程序
clearall;
b=[12];
a=[125];
t=0:
0.05:
7;
sys=tf(b,a);
f=double(t>=0)
y=lsim(sys,f,t);
subplot(2,1,1),plot(t,f,'linewidth',2);
xlabel('f(t)');
subplot(2,1,2),plot(t,y,'linewidth',2);
xlabel('yzs(t)');
clearall;
b=[28];
a=[156];
t=0:
0.05:
7;
sys=tf(b,a);
subplot(2,2,1);
impulse(sys,t);
xlabel('impulseRe');
subplot(2,2,3),
step(sys,t)
xlabel('stepRe');
f=exp(-0.5*t);
y=lsim(sys,f,t);
subplot(2,2,2),plot(t,f,'linewidth',2);
xlabel('f(t)');
subplot(2,2,4),plot(t,y,'linewidth',2);
xlabel('yzs(t)');
clearall;
b=[1.65-0.331-57690.619080];
a=[10.99643697.8121318.110];
t=0:
0.05:
7;
sys=tf(b,a);
subplot(2,2,1);
impulse(sys,t);
xlabel('impulseRe');
subplot(2,2,3),
step(sys,t)
xlabel('stepRe');
f=exp(-0.5*t);
y=lsim(sys,f,t);
subplot(2,2,2),plot(t,f,'linewidth',2);
xlabel('f(t)');
subplot(2,2,4),plot(t,y,'linewidth',2);
xlabel('yzs(t)');
clearall;
w=linspace(0,10,200);
b=[3];
a=[13];
H=freqs(b,a,w);
subplot(2,1,1),plot(w,abs(H),'linewidth',2);
set(gca,'xtick',[012345678910]);
xlabel('\omega(rad/s)');ylabel('|H(j\omega)|');gridon;
subplot(2,1,2),plot(w,angle(H),'linewidth',2);
set(gca,'xtick',[012345678910]);
xlabel('\omega(rad/s)');ylabel('phi(rad)');gridon;
figure;
w=linspace(0,5,200);
b=[105];
a=[341];
H=freqs(b,a,w);
sbplot(2,1,1),plot(w,abs(H),'linewidth',2);
set(gca,'xtick',[012345]);set(gca,'ytick',[00.40.7071]);
xlabel('\omega(rad/s)');ylabel('|H(j\omega)|');gridon;
subplot(2,1,2),plot(w,angle(H),'linewidth',2);
set(gca,'xtick',[012345]);
xlabel('\omega(rad/s)');ylabel('phi(rad)');gridon;
clearall;
w=linspace(0,8,200);
b=[0.20.31];
a=[10.41];
H=freqs(b,a,w);
subplot(2,1,1),plot(w,abs(H),'linewidth',2);
set(gca,'xtick',[012345678]);
xlabel('\omega(rad/s)');ylabel('|H(j\omega)|');gridon;
subplot(2,1,2),plot(w,angle(H),'linewidth',2);
set(gca,'xtick',[012345678]);
xlabel('\omega(rad/s)');ylabel('phi(rad)');gridon;
figure
(1)
c=[121]
d=[101]
[z,p]=tf2zp(c,d);
subplot(2,3,1);
zplane(z,p)
p=[-jj];a=poly(p);q=[-1-1];b=poly(q);
t=0:
0.02:
15;
subplot(2,3,2);
impulse(b,a,t);
subplot(2,3,3);
step(b,a,t);
c=[1000]
d=[141-6]
[z,p]=tf2zp(c,d);
subplot(2,3,4);
zplane(z,p)
p=[-3-21];a=poly(p);q=[00];b=poly(q);
t=0:
0.02:
15;
subplot(2,3,5);
impulse(b,a,t);
subplot(2,3,6);
step(b,a,t);
figure
(2)
c=[01-2]
d=[110]
[z,p]=tf2zp(c,d);
subplot(2,3,1);
zplane(z,p)
p=[0-1];a=poly(p);q=[2];b=poly(q);
t=0:
0.02:
15;
subplot(2,3,2);
impulse(b,a,t);
subplot(2,3,3);
step(b,a,t);
c=[00208]
d=[12120]
[z,p]=tf2zp(c,d);
subplot(2,3,4);
zplane(z,p)
p=[0-2-jj];
a=poly(p);q=[-j*2j*2];b=poly(q);
t=0:
0.02:
15;
subplot(2,3,5);
impulse(b,a,t);
subplot(2,3,6);
step(b,a,t);
figure(3)
c=[00016]
d=[1400]
[z,p]=tf2zp(c,d);
subplot(2,3,1);
zplane(z,p)
p=[-400];a=poly(p);q=[];b=poly(q);
t=0:
0.02:
15;
subplot(2,3,2);
impulse(b,a,t);
subplot(2,3,3);
step(b,a,t);
c=[00022]
d=[102010]
[z,p]=tf2zp(c,d);
subplot(2,3,4);
zplane(z,p)
p=[0-j-jjj];
a=poly(p);q=[-1];b=poly(q);
t=0:
0.02:
15;
subplot(2,3,5);
impulse(b,a,t);
subplot(2,3,6);
step(b,a,t);
figure
(1)
a=[10];
b=[122];
[z,p]=tf2zp(a,b);
subplot(1,3,1),zplane(z,p)
p=[-1+j-1-j];a=poly(p);q=[0];b=poly(q);
t=0:
0.02:
15;
h=freqs(b,a,w);
subplot(1,3,2),plot(w,abs(h));
subplot(1,3,3),plot(w,angle(h));
figure
(2)
a=[101.44];
b=[122];
[z,p]=tf2zp(a,b);
subplot(1,3,1),zplane(z,p)
p=[-1+j-1-j];a=poly(p);q=[1.2*j-1.2*j];b=poly(q);
t=0:
0.02:
15;
h=freqs(b,a,w);
subplot(1,3,2),plot(w,abs(h));
subplot(1,3,3),plot(w,angle(h));
figure(3)
a=[100];
b=[122];
[z,p]=tf2zp(a,b);
subplot(1,3,1),zplane(z,p)
p=[-1+j-1-j];a=poly(p);q=[00];b=poly(q);
h=freqs(b,a,w);
subplot(1,3,2),plot(w,abs(h));
subplot(1,3,3),plot(w,angle(h));
figure(4)
a=[101.44];
b=[101];
[z,p]=tf2zp(a,b);
subplot(1,3,1),zplane(z,p)
p=[-jj];a=poly(p);q=[-j*1.2j*1.2];b=poly(q);
h=freqs(b,a,w);
subplot(1,3,2),plot(w,abs(h));
subplot(1,3,3),plot(w,angle(h));
figure
(1)
p=[-2,-4];a=poly(p);q=[];b=poly(q);
subplot(2,4,1);zpplot(b,a);
t=0:
0.02:
15;
subplot(2,4,5);
impulse(b,a,t);
p=[-4-2];a=poly(p);q=[0];b=poly(q);
subplot(2,4,2);zpplot(b,a);
t=0:
0.02:
15;
subplot(2,4,6);
impulse(b,a,t);
p=[0-2-4];a=poly(p);q=[-1-4];b=poly(q);
subplot(2,4,3);zpplot(b,a);
t=0:
0.02:
15;
subplot(2,4,7);
impulse(b,a,t);
p=[-3-4-5];a=poly(p);q=[-2-1];b=poly(q);
subplot(2,4,4);zpplot(b,a);
t=0:
0.02:
15;
subplot(2,4,8);
impulse(b,a,t)