Home > classes > @pole > cp2iir.m

cp2iir

PURPOSE ^

CP2IIR Return a,b IIR filter coefficients for a complex pole designed using the bilinear transform.

SYNOPSIS ^

function [a,b] = cp2iir(p, fs)

DESCRIPTION ^

 CP2IIR Return a,b IIR filter coefficients for a complex pole designed using the bilinear transform.

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

 DESCRIPTION: CP2IIR Return a,b IIR filter coefficients for a complex pole
              designed using the bilinear transform.

 CALL:        [a,b] = cp2iir(p, fs)

 INPUT:       p  - pole object
              fs - the sample rate for the filter

 VERSION:     $Id: cp2iir.m,v 1.2 2007/07/18 13:58:45 ingo Exp $

 HISTORY:     03-04-2007 M Hewitson
                  Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [a,b] = cp2iir(p, fs)
0002 % CP2IIR Return a,b IIR filter coefficients for a complex pole designed using the bilinear transform.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: CP2IIR Return a,b IIR filter coefficients for a complex pole
0007 %              designed using the bilinear transform.
0008 %
0009 % CALL:        [a,b] = cp2iir(p, fs)
0010 %
0011 % INPUT:       p  - pole object
0012 %              fs - the sample rate for the filter
0013 %
0014 % VERSION:     $Id: cp2iir.m,v 1.2 2007/07/18 13:58:45 ingo Exp $
0015 %
0016 % HISTORY:     03-04-2007 M Hewitson
0017 %                  Creation
0018 %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 
0021 f0 = get(p, 'f');
0022 q  = get(p, 'q');
0023 
0024 w0 = f0*2*pi;
0025 w02 = w0^2;
0026 
0027 k = (q*w02 + 4*q*fs*fs + 2*w0*fs) / (q*w02);
0028 b(1) = 1;
0029 b(2) = (2*w02-8*fs*fs) / (k*w02);
0030 b(3) = (q*w02 + 4*q*fs*fs - 2*w0*fs) / (k*q*w02);
0031 
0032 a(1) = 1/k;
0033 a(2) = -2/k;
0034 a(3) = -1/k;
0035 a = a*-2;
0036 
0037 % END

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003