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