1、实验六四A=0,1,0,0;0,0,1,0;0,0,0,1;-65.5,-213.8,-204.2,-54;B=0;0;0;1;C=1562,1875,0,0;D=0; sys=ss(A,B,C,D); bode(sys);-150-100-50050Magnitude (dB)10-2 10-1 100 101 102 103-270-180-900Phase (deg)Bode DiagramFrequency (rad/sec)六1 b=1; a=1,1; freqz(b,a);0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1050100Normalized
2、 Frequency ( rad/sample)Phase(degrees)0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-200204060Normalized Frequency ( rad/sample)Magnitude (dB) clear;num=1,0;den=1,1;dbode(num,den,1);-1000100200300400Magnitude (dB)10-1 100 10104590Phase (deg)Bode DiagramFrequency (rad/sec)2 w=0:0.05:20; num=2,0; den=1,sqrt(
3、2),1; h=freqs(num,den,w); mag=abs(h); phase=angle(h); subplot(2,1,1) plot(w,mag); title(幅频特性) subplot(2,1,2); plot(w,phase); title(相频特性)0 2 4 6 8 10 12 14 16 18 20-2-1012 幅幅幅幅0 2 4 6 8 10 12 14 16 18 2000.511.5 幅幅幅幅clear; num=2,0; den=1,sqrt(2),1; sys=tf(num,den); bode(sys);-50-40-30-20-10010Magnitu
4、de (dB)10-2 10-1 100 101 102-90-4504590Phase (deg)Bode DiagramFrequency (rad/sec)3 clear; b=1,2,1; a=1,0,0.61; freqz(b,a);10-2 10-1 100-200-1000100Normalized Frequency ( rad/sample)Phase(degrees)0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100-50050Normalized Frequency ( rad/sample)Magnitude (dB) clear;
5、b=1,2,1; a=1,0,0.61; dbode(b,a,1);-300-200-1000100Magnitude (dB)10-2 10-1 100 101-180-135-90-450Phase (deg)Bode DiagramFrequency (rad/sec)4 clear; z=1;2; p=-1;-2; k=3; num,den=zp2tf(z,p,k); w=0:0.05:20; h=freqs(num,den,w); mag=abs(h); phase=angle(h); subplot(2,1,1) plot(w,mag);title(幅频特性)subplot(2,1
6、,2);plot(w,phase); title(相频特性 )0 2 4 6 8 10 12 14 16 18 20333 幅幅幅幅0 2 4 6 8 10 12 14 16 18 20-4-2024 幅幅幅幅 clear;z=1;2;p=-1;-2;k=3; num,den=zp2tf(z,p,k);sys=tf(num,den);bode(sys);9.54249.54249.54249.54249.54249.54249.5424Magnitude (dB)10-2 10-1 100 101 102090180270360Phase (deg)Bode DiagramFrequency
7、(rad/sec)实验十一一1t=0.5;N=20;fs=N/t;T=1/fs;n = -N:1:N;xn=(sin(10*pi*n*T)+eps)./(10*pi*n*T+eps);X = fft(xn,4096);f=0:4095/4096/T;plot(f,abs(X)0 5 10 15 20 25 30 35 4000.511.522.533.544.52 clear; t=0.2;N=20;fs=N/t;T=1/fs;n = -N:1:N;xn=(sin(10*pi*n*T)+eps)./(10*pi*n*T+eps);X = fft(xn,4096);f=0:4095/4096/T;plot(f,abs(X)0 10 20 30 40 50 60 70 80 90 1000246810123 clear; t=0.01;N=20;fs=N/t;T=1/fs; n = -N:1:N; xn=(sin(10*pi*n*T)+eps)./(10*pi*n*T+eps); X = fft(xn,4096); f=0:4095/4096/T; plot(f,abs(X)