📄 chebpole.m
字号:
function [pc,pb] = chebpole(n,r)
% CHEBPOLE Geometric construction of Chebyshev poles.
%
% [PC,PB] = CHEBPOLE(N,R) Chebyshev poles and their location
% PC, PB return the Chebyshev and NORMALIZED Butterworth poles
% N = filter order, R = passband ripple in dB [Default: 3.01 dB]
%
% CHEBPOLE plots poles and shows the geometric construction for
% obtaining the Chebyshev poles from the Butterworth poles.
%
% CHEBPOLE (with no input arguments) invokes the following example:
%
% % Pole locations for a 4th order Chebyshev filter with r = 0.5 dB
% >>poles = chebpole(4,0.5)
% ADSP Toolbox: Version 2.0
% For use with "Analog and Digital Signal Processing", 2nd Ed.
% Published by PWS Publishing Co.
%
% Ashok Ambardar, EE Dept. MTU, Houghton, MI 49931, USA
% http://www.ee.mtu/faculty/akambard.html
% e-mail: akambard@mtu.edu
% Copyright (c) 1998
if nargin==0,help chebpole,disp('Strike a key to see results of the example')
pause,poles=chebpole(4,0.5),return,end
j=sqrt(-1);a=3;if exist('version')==5,a=4;else,a=3;end
if nargin<2,r=10*log10(2);end,
esq=(10)^(0.1*r)-1;es=sqrt(esq);
n1=fix(n/2);ak=[];wk=[];
if n1>0,k=(1:n1)';tk=.5*pi*(2*k-1)/n;
ak=-sin(tk);wk=cos(tk);ak=[ak;ak];wk=[wk;-wk];end
if rem(n,2)==1,ak=[ak;-1];wk=[wk;0];end,
pb=ak+j*wk;
%pb=cplxpair(pb);
br=real(pb);bi=imag(pb);mu=asinh(1/es)/n;
c1r=sinh(mu)*br;c1i=cosh(mu)*bi;pc=c1r+j*c1i;s=abs(cosh(mu));
if a==3,axis('square');axis([-s s -s s]);end
ellipse(cosh(mu),':');
if a==4,axis([-s s -s s]);axis('square');end
hold on,ellipse([sinh(mu),cosh(mu)],':');
ellipse(1,':');plot(br,bi,'x'),ca=c1r';cb=c1i';
cc=br';cd=bi';z1=zeros(1,length(ca));
plot([z1;ca],[z1;cb],':')
plot([z1;cc*cosh(mu)],[z1;cd*cosh(mu)],':')
ellipse(sinh(mu),':');
plot([ca; cc*cosh(mu)],[cb; cd*cosh(mu)],'-')
plot([ca; cc*sinh(mu)],[cb; cd*sinh(mu)],'-')
plot([c1r -c1r],[c1i c1i],'*')
nn=int2str(n);ess=num2str(es);rr=num2str(r);
title(['Chebyshev poles(*): n = ' nn ', r = ' rr ' dB, eps = ' ess]),
hold off,
if a==3,pause,axis('normal');end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -