Home > classes > @zero > cz2iir.m

cz2iir

PURPOSE ^

CZ2IIR return a,b IIR filter coefficients for a complex zero designed using the bilinear transform.

SYNOPSIS ^

function [a,b] = cz2iir(z, fs)

DESCRIPTION ^

 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/01/11 13:42:41 ingo Exp $

 HISTORY:     03-04-2007 Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [a,b] = cz2iir(z, fs)
0002 % CZ2IIR return a,b IIR filter coefficients for a complex zero designed using the bilinear transform.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: CZ2IIR return a,b IIR filter coefficients for a complex zero
0007 %              designed using the bilinear transform.
0008 %
0009 % CALL:        [a,b] = cz2iir(z, fs)
0010 %
0011 % REMARK:      This is just a helper function. This function should only be
0012 %              called from class functions.
0013 %
0014 % INPUTS:      z  - zero object
0015 %              fs - the sample rate for the filter
0016 %
0017 % VERSION:     $Id: cz2iir.m,v 1.4 2008/01/11 13:42:41 ingo Exp $
0018 %
0019 % HISTORY:     03-04-2007 Hewitson
0020 %                 Creation
0021 %
0022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0023 
0024 VERSION = '$Id: cz2iir.m,v 1.4 2008/01/11 13:42:41 ingo Exp $';
0025 
0026 %%%%%   'Params' && 'Version' Call   %%%%%
0027 if nargin == 2
0028   if isa(z, 'zero') && ischar(fs)
0029     in = fs;
0030     if strcmp(in, 'Params')
0031       a = plist();
0032       return
0033     elseif strcmp(in, 'Version')
0034       a = VERSION;
0035       return
0036     end
0037   end
0038 end
0039 
0040 f0 = get(z, 'f');
0041 q  = get(z, 'q');
0042 
0043 w0  = f0*2*pi;
0044 w02 = w0^2;
0045 
0046 a(1) = (-q*w02/2 - 2*q*fs*fs - w0*fs) / (q*w02);
0047 a(2) = (-w02+4*fs*fs) / w02;
0048 a(3) = (-q*w02/2 - 2*q*fs*fs + w0*fs) / (q*w02);
0049 
0050 b(1) =  1;
0051 b(2) = -2;
0052 b(3) = -1;
0053 
0054 % END

Generated on Tue 22-Jan-2008 10:39:13 by m2html © 2003