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