📄 ex_13_01_1.m
字号:
% ex_13_01_1.m : 习题 13.1
clear all;
close all;
b=1
a=[1.000 -1.844 0.849643];
aa=roots(a);
abs(aa);
[h,w] = freqz(b,a,512,1);
H = 20*log10(abs(h)/max(abs(h)));
figure('color','w')
%
at = truncation(a,1);
at1=roots(at)
abs(at1)
[ht,w] = freqz(b,at,512,1);
Ht = 20*log10(abs(ht)/max(abs(ht))+eps);
subplot(441)
plot(w,H,'b',w,Ht,'r:');grid
subplot(442)
zplane(b,at);xlabel(' ');ylabel(' ');
ar = rounding(a,1);
ar1=roots(ar)
abs(ar1)
[hr,w] = freqz(b,ar,512,1);
Hr = 20*log10(abs(hr)/max(abs(hr))+eps);
subplot(443)
plot(w,H,'b',w,Hr,'r:');grid
subplot(444)
zplane(b,ar);xlabel(' ');ylabel(' ');
at = truncation(a,2);
at2=roots(at)
abs(at2)
[ht,w] = freqz(b,at,512,1);
Ht = 20*log10(abs(ht)/max(abs(ht))+eps);
subplot(445)
plot(w,H,'b',w,Ht,'r:');grid
subplot(446)
zplane(b,at);xlabel(' ');ylabel(' ');
ar = rounding(a,2);
ar2=roots(ar)
abs(ar2)
[hr,w] = freqz(b,ar,512,1);
Hr = 20*log10(abs(hr)/max(abs(hr))+eps);
subplot(447)
plot(w,H,'b',w,Hr,'r:');grid
subplot(448)
zplane(b,ar);xlabel(' ');ylabel(' ');
at = truncation(a,3);
at3=roots(at)
abs(at3)
[ht,w] = freqz(b,at,512,1);
Ht = 20*log10(abs(ht)/max(abs(ht))+eps);
subplot(449)
plot(w,H,'b',w,Ht,'r:');grid
subplot(4,4,10)
zplane(b,at);xlabel(' ');ylabel(' ');
ar = rounding(a,3);
ar3=roots(ar)
abs(ar3)
[hr,w] = freqz(b,ar,512,1);
Hr = 20*log10(abs(hr)/max(abs(hr))+eps);
subplot(4,4,11)
plot(w,H,'b',w,Hr,'r:');grid
subplot(4,4,12)
zplane(b,ar);xlabel(' ');ylabel(' ');
at = truncation(a,4);
at4=roots(at)
abs(at4)
[ht,w] = freqz(b,at,512,1);
Ht = 20*log10(abs(ht)/max(abs(ht))+eps);
subplot(4,4,13)
plot(w,H,'b',w,Ht,'r:');grid
subplot(4,4,14)
zplane(b,at);xlabel(' ');ylabel(' ');
ar = rounding(a,4);
ar4=roots(ar)
abs(ar4)
[hr,w] = freqz(b,ar,512,1);
Hr = 20*log10(abs(hr)/max(abs(hr))+eps);
subplot(4,4,15)
plot(w,H,'b',w,Hr,'r:');grid
subplot(4,4,16)
zplane(b,ar);xlabel(' ');ylabel(' ');
%-------------------------------------------------------------
figure('color','w')
at = truncation(a,5);
at5=roots(at)
abs(at5)
[ht,w] = freqz(b,at,512,1);
Ht = 20*log10(abs(ht)/max(abs(ht))+eps);
subplot(441)
plot(w,H,'b',w,Ht,'r:');grid
subplot(442)
zplane(b,at);xlabel(' ');ylabel(' ');
ar = rounding(a,5);
ar5=roots(ar)
abs(ar5)
[hr,w] = freqz(b,ar,512,1);
Hr = 20*log10(abs(hr)/max(abs(hr))+eps);
subplot(443)
plot(w,H,'b',w,Hr,'r:');grid
subplot(444)
zplane(b,ar);xlabel(' ');ylabel(' ');
at = truncation(a,6);
at6=roots(at)
abs(at6)
[ht,w] = freqz(b,at,512,1);
Ht = 20*log10(abs(ht)/max(abs(ht))+eps);
subplot(445)
plot(w,H,'b',w,Ht,'r:');grid
subplot(446)
zplane(b,at);xlabel(' ');ylabel(' ');
ar = rounding(a,6);
ar6=roots(ar)
abs(ar6)
[hr,w] = freqz(b,ar,512,1);
Hr = 20*log10(abs(hr)/max(abs(hr))+eps);
subplot(447)
plot(w,H,'b',w,Hr,'r:');grid
subplot(448)
zplane(b,ar);xlabel(' ');ylabel(' ');
at = truncation(a,7);
at7=roots(at)
abs(at7)
[ht,w] = freqz(b,at,512,1);
Ht = 20*log10(abs(ht)/max(abs(ht))+eps);
subplot(449)
plot(w,H,'b',w,Ht,'r:');grid
subplot(4,4,10)
zplane(b,at);xlabel(' ');ylabel(' ');
ar = rounding(a,7);
ar7=roots(ar)
abs(ar7)
[hr,w] = freqz(b,ar,512,1);
Hr = 20*log10(abs(hr)/max(abs(hr))+eps);
subplot(4,4,11)
plot(w,H,'b',w,Hr,'r:');grid
subplot(4,4,12)
zplane(b,ar);xlabel(' ');ylabel(' ');
at = truncation(a,8);
at8=roots(at)
abs(at8)
[ht,w] = freqz(b,at,512,1);
Ht = 20*log10(abs(ht)/max(abs(ht))+eps);
subplot(4,4,13)
plot(w,H,'b',w,Ht,'r:');grid
subplot(4,4,14)
zplane(b,at);xlabel(' ');ylabel(' ');
ar = rounding(a,8);
ar8=roots(ar)
abs(ar8)
[hr,w] = freqz(b,ar,512,1);
Hr = 20*log10(abs(hr)/max(abs(hr))+eps);
subplot(4,4,15)
plot(w,H,'b',w,Hr,'r:');grid
subplot(4,4,16)
zplane(b,ar);xlabel(' ');ylabel(' ');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -