fg_06_09.m

来自「英文书《Digital Signal Processing with Examp」· M 代码 · 共 32 行

M
32
字号
% fg_06_09  Butterworth translation.
L=10;
wc=.32;
w1=.32;
w2=.64;
sp_fig(1);
clr=['r' 'g' 'b' 'c'];
axvect=[-.4 .1 -1 1];
ttl=str2mat('Lowpass','Highpass','Bandpass','Bandstop');
for band=1:4,
   [d,c]=bw_analog_weights(band,L,w1,w2);
   p=-c(:,2)./c(:,1);                              % poles
   subplot(2,2,band);
   axis(axvect); grid;
   set(gca,'fontsize',14);
   x=real(p); y=imag(p);
   h=line([x x],[y -y],'linestyle','none','marker','x','color',clr(band));
   set(h,'markersize',10);
   if band>1,
       z=-d(:,2)./d(:,1);                          % zeros
       x=real(z); y=imag(z);
       h=line([x x],[y -y],'linestyle','none','marker','o','color',clr(band));
       set(h,'markersize',10);
   end
   if(band>2)
      xlabel('Re(s)');
   end
   line([0 0],[-3 3],'color','k');
   line([-1 1],[0 0],'color','k');
   ylabel('Im(s)');
   title(ttl(band,:));
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?