1、实验三1,. 利用 DFT 近似分析连续信号 x(t)=e-2tu(t)的幅度谱并与理论值比较,将理论频谱曲线和实际计算频谱曲线绘制在一个坐标系中。 (要求根据实际幅度频谱函数|X(j)| 选择合适的抽样频率,根据时域波形选择合适的窗长度,根据序列点数选择合适的 DFT 点数。同时,减小抽样频率,观察最终理论值与计算值间的误差变化。 )fsam=50;Tp=6;N=512;T=1/fsam;t=0:T:Tp;x=exp(-2*t);X=T*fft(x,N);plot(t,x);xlabel(t);title(时域波形);w=(-N/2:N/2-1)*(2*pi/N)*fsam;y=1./(j*
2、w+2);figure; plot(w,abs(fftshift(X),w,abs(y),r-.);title(幅度谱);xlabel(w);legend(计算值 ,理论值 );2.近似分析门函数信号 的幅度谱,并与理论值比较,将理论频谱曲线和实2()gt际计算频谱曲线绘制在一个坐标系中,其中分别选其最高频带上限 为 、m、 时三种情况,比较结果并简单解释其区别及原因。 (根据门函数的416理论频谱表达式 ,当 时值为 0,并随自变sin()()2()San量绝对值的增大呈递减趋势)fsam=16;N=512;T=1/fsam;t=-2:T:2;0 1 2 3 4 5 600.20.40.60
3、.81t为为为为-200 -100 0 100 20000.20.40.60.8 为为为w为为为为为为x=(t=-1)x=(0.5.k).*h;y=conv(x,h);ky=2*k(1):2*k(end);subplot(3,1,1);stem(k,x);xlabel(k);ylabel(x);subplot(3,1,2);stem(k,h);xlabel(k);ylabel(h);subplot(3,1,3);stem(ky,y);xlabel(ky);ylabel(y);-2 0 2 4 6 8 1000.51kx-2 0 2 4 6 8 1000.51kh-5 0 5 10 15 200
4、12kyy3.已知连续系统的微分方程为 ,计算该系统的单位冲()43()ttyft激响应和单位阶跃响应,绘制响应的曲线波形图,并与理论结果比较。a=1,4,3;b=1;sys=tf(b,a);h=impulse(sys);g=step(sys);subplot(2,2,1);plot(h);title(系统的单位冲击响应 h(t);subplot(2,2,2);plot(g);title(系统的单位冲击响应 g(t);t=0:0.01:10;h=(exp(-t)-exp(-3*t)/2;g=(-exp(-t)/2+exp(-3*t)/6+1/3;subplot(2,2,3);plot(h);t
5、itle(系统的单位冲击响应的理论值 h(t);subplot(2,2,4);plot(g);title(系统的单位冲击响应的理论值 g(t) );0 50 100 15000.10.2为为为为为为为为为 h(t)0 50 100 15000.20.4为为为为为为为为为 g(t)0 500 1000 150000.10.2为为为为为为为为为为为为为 h(t)0 500 1000 1500-0.200.20.4为为为为为为为为为为为为为 g(t)4. 计算并绘制由如下微分方程表示的系统在输入信号为 x(t) = (e-2t - e-3t)u(t)时的系统零状态响应并描绘曲线。)(82)(3)(2
6、 txtydttya=1,3,2;b=8;sys=tf(b,a);t=0:0.01:10;x=exp(-2*t)-exp(-3*t);y= lsim (sys ,x ,t);plot(t,y);0 2 4 6 8 1000.050.10.150.20.250.30.355.已知连续系统 ,求输入分别为 和 时系统的零321()sHsin()tu()te状态响应,将响应图形分别显示在两个图形窗口,并与理论结果比较。a=1,3,2,0;b=4,1;sys=tf(b.a);t=0:0.01:10;x1=sin(t);x2=exp(-t);y1=lsim(sys,x1,t);y2=lsim(sys,x
7、2,t);subplot(2,1,1);plot(t,y1);title(输入为 sim(t)u(t)时系统的零状态响应);subplot(2,1,2);plot(t,y2);title(输入为 exp(-t)u(t)时系统的零状态响应);0 1 2 3 4 5 6 7 8 9 10-1012 为为为 sim(t)u(t)为为为为为为为为为0 1 2 3 4 5 6 7 8 9 1000.51 为为为 exp(-t)u(t)为为为为为为为为为实验五第一题 1.给定连续时间 LTI 系统的微分方程分别为, 利用该程序计算并绘制由微分方程描dtxydtty)(25)(1)(2述的系统的幅度响应特性
8、、相位响应特性、频率响应的实部和频率响应的虚部曲线图。b = 1,0; a = 1,1,25; H,w = freqs(b,a); Hm = abs(H); phai = angle(H); Hr = real(H); Hi = imag(H); subplot(221)plot(w,Hm),grid on,title(Magnitude response),xlabel(Frequency in rad/sec)subplot(223)plot(w,phai), grid on, title(Phase response), xlabel(Frequency in rad/sec)subpl
9、ot(222)plot(w,Hr), grid on, title(Real part of frequency response), xlabel(Frequency in rad/sec)subplot(224)plot(w,Hi), grid on, title(Imaginary part of frequency response), xlabel(Frequency in rad/sec)0 5 1000.51 Magnitude responseFrequency in rad/sec0 5 10-202 Phase responseFrequency in rad/sec0 5
10、 1000.51Real part of frequency responseFrequency in rad/sec0 5 10-0.500.5Imaginary part of frequency responseFrequency in rad/sec第二题 给定连续时间 LTI 系统的微分方程分别为 ,)()(txdty利用该程序计算并绘制由微分方程描述的系统的幅度响应特性、相位响应特性、频率响应的实部和频率响应的虚部曲线图。 b = 1,-1; a = 1,1; H,w = freqs(b,a); Hm = abs(H); phai = angle(H); Hr = real(H);
11、 Hi = imag(H); subplot(221)plot(w,Hm),grid on,title(Magnitude response),xlabel(Frequency in rad/sec)subplot(223)plot(w,phai), grid on, title(Phase response), xlabel(Frequency in rad/sec)subplot(222)plot(w,Hr), grid on, title(Real part of frequency response), xlabel(Frequency in rad/sec)subplot(224)p
12、lot(w,Hi), grid on, title(Imaginary part of frequency response), xlabel(Frequency in rad/sec)0 5 10111 Magnitude responseFrequency in rad/sec0 5 10024 Phase responseFrequency in rad/sec0 5 10-101Real part of frequency responseFrequency in rad/sec0 5 1000.51Imaginary part of frequency responseFrequen
13、cy in rad/sec第三题 给定连续时间 LTI 系统的微分方程分别为 )(26)()(401)(306)(148)()(10)( 2456 txtyttdtttdty 利用该程序计算并绘制由微分方程描述的系统的幅度响应特性、相位响应特性、频率响应的实部和频率响应的虚部曲线图。b = 262; a = 1,10,48,148,306,401,262; H,w = freqs(b,a); Hm = abs(H); phai = angle(H); Hr = real(H); Hi = imag(H); subplot(221)plot(w,Hm),grid on,title(Magnitu
14、de response),xlabel(Frequency in rad/sec)subplot(223)plot(w,phai), grid on, title(Phase response), xlabel(Frequency in rad/sec)subplot(222)plot(w,Hr), grid on, title(Real part of frequency response), xlabel(Frequency in rad/sec)subplot(224)plot(w,Hi), grid on, title(Imaginary part of frequency respo
15、nse), xlabel(Frequency in rad/sec)0 5 1000.51 Magnitude responseFrequency in rad/sec0 5 10-505 Phase responseFrequency in rad/sec0 5 10-101Real part of frequency responseFrequency in rad/sec0 5 10-101Imaginary part of frequency responseFrequency in rad/sec实验六1. 第一题 已知某连续系统的系统函数为 ,计算该系统的32597()ss零极点,
16、并作出零极点分布图。b=1,5,9,7;a=1,3,2;z=roots(b);p=roots(a);sys=tf(b,a);pzmap(sys)命令窗口得z =-2.5437 -1.2282 + 1.1151i-1.2282 - 1.1151ip =-2-1-3 -2.5 -2 -1.5 -1 -0.5 0-1.5-1-0.500.511.5Pole-Zero MapReal AxisImaginaryAxis第二题 已知某连续系统具有以下零极点:零点在 ,极点在 ,增益0.5s0.15sj。1k(1)利用 conv 函数和 tf 函数建立系统的系统函数,并画出系统的零极点图;(2)分析系统是
17、否稳定。若稳定,画出系统的幅度响应曲线。(3)画出系统的冲激响应波形,观察其冲激响应波形是什么类型的信号?通过分析该系统极点分布特性是否得到同样结论?作简要分析并回答。第一问b=1,-0.5;a1=1,0.1+j*5;a2=1,0.1-j*5;a=conv(a1,a2);z=roots(b);p=roots(a);sys=tf(b,a);pzmap(sys)-0.1 0 0.1 0.2 0.3 0.4 0.5 0.6-5-4-3-2-1012345 Pole-Zero MapReal AxisImaginaryAxis第二问b=1,-0.5;a1=1,0.1+j*5;a2=1,0.1-j*5;
18、a=conv(a1,a2);H,w=freqs(b,a);Hm=abs(H);plot(w,Hw);grid on;title(Magnitude response);xlabel(Frequency in rad/sec);0 1 2 3 4 5 6 7 8 9 10012345 Magnitude responseFrequency in rad/sec第三问b=1,-0.5;a1=1,0.1+j*5;a2=1,0.1-j*5;a=conv(a1,a2);sys=tf(b,a);t=-2:0.001:10;h=impulse(sys);plot(h);title(系统的冲击响应);0 50
19、0 1000 1500-1-0.8-0.6-0.4-0.200.20.40.60.81 为为为为为为为第三题已知一个因果系统的系统函数为 ,作用于系统的输入信615)(23ssH号为 ,用 MATLAB 作出系统的频率响应曲线,并求解系统的零状)()(4tuetx态响应。figure 1b=1,5;a=1,6,11,6;sys=tf(b,a);t=0:0.001:10;x=exp(-4*t);y=lsim(sys,x,t);plot(t,y);title(系统的零状态响应);figure 2b=1,5;a=1,6,11,6;H,w = freqs(b,a); Hm = abs(H); phai
20、 = angle(H); Hr = real(H); Hi = imag(H); subplot(221)plot(w,Hm),grid on,title(Magnitude response),xlabel(Frequency in rad/sec)subplot(223)plot(w,phai), grid on, title(Phase response), xlabel(Frequency in rad/sec)subplot(222)plot(w,Hr), grid on, title(Real part of frequency response), xlabel(Frequenc
21、y in rad/sec)subplot(224)plot(w,Hi), grid on, title(Imaginary part of frequency response), xlabel(Frequency in rad/sec)0 2 4 6 8 1000.020.040.060.080.1 为为为为为为为为0 50 10000.51 Magnitude responseFrequency in rad/sec0 50 100-4-20 Phase responseFrequency in rad/sec0 50 100-101Real part of frequency responseFrequency in rad/sec0 50 100-1-0.50Imaginary part of frequency responseFrequency in rad/sec