📄 buttpole.m
字号:
function [pb,pbn] = buttpole(n,r)
% BUTTPOLE Location of Butterworth poles.
%
% [P,PN] = BUTTPOLE(N,R) returns location of Butterworth poles
% N = filter order, R = passband attenuation dB [Default: R = 3.01 dB].
%
% P contains the poles of the BW filter
% PN contains poles of the normalized BW filter (w3 = 1 or r=3.01dB).
% A plot of the pole locations is also drawn.
%
% BUTTPOLE (with no input arguments) invokes the following example:
%
% % Find the poles of a 6th order BW LPF with passband attn = 1dB
% >> pbutt = buttpole(6,1)
% 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 buttpole,disp('Strike a key to see results of the example')
pause,pbutt=buttpole(6,1),return,end
if nargin==1,w3=1;else,es=sqrt((10)^(0.1*r)-1);w3=(1/es)^(1/n);end
j=sqrt(-1);a=3;
if exist('version')==5,a=4;else,a=3;end
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;pbn=pb;
if w3~=1,pb=pb*w3;end
%pb=cplxpair(pb);
br=real(pb);bi=imag(pb);
cc=br(:)';cd=bi(:)';z1=zeros(1,length(cc));s=1.2*w3;
if a==3,axis('square');axis([-s s -s s]);end
if a==4,axis([-s s -s s]);axis('square');end
ellipse(w3,':');
if a==4,axis([-s s -s s]);axis('square');end,hold on
ellipse(1,':'),plot(br,bi,'x',-br,bi,'x'),
plot([z1;cc],[z1;cd],':'),axesn
ww=num2str(w3);nn=int2str(n);rr=num2str(r);
title(['Butterworth poles: n = ' nn ', r = ' rr ' dB, nu3 = ' ww]),
hold off,
if a==3,pause,axis('normal');end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -