共四个二阶网络的系统函数,画系统零极点分布图,求各系统单位脉冲响应,画波形
H1
clc;
clear all;
close all;
A=[1,-1.6,0.9425];
B=[1,0,0];
figure
zplane(B,A);
z=roots(B) %zero-point
p=roots(A) %polar-point
pm=abs(p);
if max(pm)<1
disp('system is stable and causal'),
else
disp('system is not stable and causal'),
end
[h1n,n]=impz(B,A,100);
figure
stem(n,h1n,'.');
line([0,100],[0,0])
xlabel('n');
ylabel('h1n');
零点在原点,零点不影响系统频率特性,零点不影响单位脉冲响应
H2
clc;
clear all;
close all;
A=[1,-1.6,0.9425];
B=[1,-0.3,0];
figure
zplane(B,A);
z=roots(B) %zero-point
p=roots(A) %polar-point
pm=abs(p);
if max(pm)<1
disp('system is stable and causal'),
else
disp('system is not stable and causal'),
end
[h1n,n]=impz(B,A,100);
figure
stem(n,h1n,'.');
xlabel('n');
ylabel('h1n');
axis([0 100 -2 2]);
零点离极点比较远
H3
clc;
clear all;
close all;
A=[1,-1.6,0.9425];
B=[1,-0.8,0];
figure
zplane(B,A);
z=roots(B) %zero-point
p=roots(A) %polar-point
pm=abs(p);
if max(pm)<1
disp('system is stable and causal'),
else
disp('system is not stable and causal'),
end
[h1n,n]=impz(B,A,100);
figure
stem(n,h1n,'.');
xlabel('n');
ylabel('h1n');
axis([0 100 -2 2]);
H4
clc;
clear all;
close all;
A=[1,-1.6,0.9425];
B=[1,-1.6,0.8];
figure
zplane(B,A);
z=roots(B) %zero-point
p=roots(A) %polar-point
pm=abs(p);
if max(pm)<1
disp('system is stable and causal'),
else
disp('system is not stable and causal'),
end
[h1n,n]=impz(B,A,100);
figure
stem(n,h1n,'.');
xlabel('n');
ylabel('h1n');
axis([0 100 -2 2]);
零点越靠近极点,单位脉冲响应的变化越缓慢,零点对极点有抵消作用。第4种有两个靠近polar point的zero point,抵消作用更明显
可以把全部图像画在一起观察,更直观
clc;
clear all;
close all;
A=[1,-1.6,0.9425];
B1=[1,0,0];
B2=[1,-0.3,0];
B3=[1,-0.8,0];
B4=[1,-1.6,0.8];
z1=roots(B1) %zero-point
z2=roots(B2) %zero-point
z3=roots(B3) %zero-point
z4=roots(B4) %zero-point
p=roots(A) %polar-point
pm=abs(p);
if max(pm)<1
disp('system is stable and causal'),
else
disp('system is not stable and causal'),
end
[h1n,n]=impz(B1,A,100);
[h2n,n]=impz(B2,A,100);
[h3n,n]=impz(B3,A,100);
[h4n,n]=impz(B4,A,100);
figure
stem(n,h1n,'.','r');
xlabel('n');
ylabel('h1n');
axis([0 100 -2 2]);
hold on
stem(n,h2n,'.','b');
xlabel('n');
ylabel('h2n');
axis([0 100 -2 2]);
hold on
stem(n,h3n,'.','k');
xlabel('n');
ylabel('h3n');
axis([0 100 -2 2]);
hold on
stem(n,h4n,'.','g');
xlabel('n');
ylabel('h4n');
axis([0 100 -2 2]);
hold off