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.4 2008/09/04 15:29:31 ingo Exp $ HISTORY: 03-03-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % RP2IIR Return a,b coefficients for a real pole designed using the bilinear transform. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: RP2IIR Return a,b coefficients for a real pole designed using 0005 % the bilinear transform. 0006 % 0007 % CALL: filt = rpole(p, fs) 0008 % 0009 % REMARK: This is just a helper function. This function should only be 0010 % called from class functions. 0011 % 0012 % INPUT: p - pole object 0013 % fs - the sample rate for the filter 0014 % 0015 % VERSION: $Id: rp2iir.m,v 1.4 2008/09/04 15:29:31 ingo Exp $ 0016 % 0017 % HISTORY: 03-03-07 M Hewitson 0018 % Creation 0019 % 0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0021 0022 function varargout = rp2iir(varargin) 0023 0024 %%% Check if this is a call for parameters 0025 if utils.helper.isinfocall(varargin{:}) 0026 varargout{1} = getInfo(varargin{3}); 0027 return 0028 end 0029 0030 p = varargin{1}; 0031 fs = varargin{2}; 0032 0033 f0 = p.f; 0034 w0 = f0*2*pi; 0035 a(1) = w0 / (2*fs + w0); 0036 a(2) = a(1); 0037 b(1) = 1; 0038 b(2) = (w0-2*fs) / (w0+2*fs); 0039 0040 varargout{1} = a; 0041 varargout{2} = b; 0042 end 0043 0044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0045 % Local Functions % 0046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0047 0048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0049 % 0050 % FUNCTION: getInfo 0051 % 0052 % DESCRIPTION: Get Info Object 0053 % 0054 % HISTORY: 11-07-07 M Hewitson 0055 % Creation. 0056 % 0057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0058 0059 function ii = getInfo(varargin) 0060 if nargin == 1 && strcmpi(varargin{1}, 'None') 0061 sets = {}; 0062 pl = []; 0063 else 0064 sets = {'Default'}; 0065 pl = getDefaultPlist; 0066 end 0067 % Build info object 0068 ii = minfo(mfilename, 'pz', '', utils.const.categories.internal, '$Id: rp2iir.m,v 1.4 2008/09/04 15:29:31 ingo Exp $', sets, pl); 0069 end 0070 0071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0072 % 0073 % FUNCTION: getDefaultPlist 0074 % 0075 % DESCRIPTION: Get Default Plist 0076 % 0077 % HISTORY: 11-07-07 M Hewitson 0078 % Creation. 0079 % 0080 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0081 0082 function plo = getDefaultPlist() 0083 plo = plist(); 0084 end 0085