RP2IIR Return a,b coefficients for a real pole designed using the bilinear transform. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: RP2IIR Return a,b coefficients for a real pole designed using the bilinear transform. CALL: filt = rpole(p, fs) REMARK: This is just a helper function. This function should only be called from class functions. INPUT: p - pole object fs - the sample rate for the filter VERSION: $Id: rp2iir.m,v 1.5 2008/02/12 21:38:23 hewitson Exp $ HISTORY: 03-03-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function [a,b] = rp2iir(p, fs) 0002 % RP2IIR Return a,b coefficients for a real pole designed using the bilinear transform. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: RP2IIR Return a,b coefficients for a real pole designed using 0007 % the bilinear transform. 0008 % 0009 % CALL: filt = rpole(p, fs) 0010 % 0011 % REMARK: This is just a helper function. This function should only be 0012 % called from class functions. 0013 % 0014 % INPUT: p - pole object 0015 % fs - the sample rate for the filter 0016 % 0017 % VERSION: $Id: rp2iir.m,v 1.5 2008/02/12 21:38:23 hewitson Exp $ 0018 % 0019 % HISTORY: 03-03-07 M Hewitson 0020 % Creation 0021 % 0022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0023 0024 VERSION = '$Id: rp2iir.m,v 1.5 2008/02/12 21:38:23 hewitson Exp $'; 0025 CATEGORY = 'Internal'; 0026 0027 %%%%% 'Params' && 'Version' Call %%%%% 0028 if nargin == 2 0029 if isa(p, 'pole') && ischar(fs) 0030 in = fs; 0031 if strcmp(in, 'Params') 0032 a = plist(); 0033 return 0034 elseif strcmp(in, 'Version') 0035 a = VERSION; 0036 return 0037 elseif strcmp(in, 'Category') 0038 a = CATEGORY; 0039 return 0040 end 0041 end 0042 end 0043 0044 f0 = get(p, 'f'); 0045 w0 = f0*2*pi; 0046 a(1) = w0 / (2*fs + w0); 0047 a(2) = a(1); 0048 b(1) = 1; 0049 b(2) = (w0-2*fs) / (w0+2*fs); 0050 0051 % END