Home > classes > @pole > cp2iir.m

cp2iir

PURPOSE ^

Return a,b IIR filter coefficients for a complex pole

SYNOPSIS ^

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

DESCRIPTION ^

 Return a,b IIR filter coefficients for a complex pole
 designed using the bilinear transform.
 
 usage: [a,b] = cp2iir(p, fs)
 
  p  - pole object
  fs - the sample rate for the filter
 
  M Hewitson 03-04-07
 
 $Id: cp2iir.html,v 1.1 2007/06/08 14:15:07 hewitson Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [a,b] = cp2iir(p, fs)
0002  
0003 % Return a,b IIR filter coefficients for a complex pole
0004 % designed using the bilinear transform.
0005 %
0006 % usage: [a,b] = cp2iir(p, fs)
0007 %
0008 %  p  - pole object
0009 %  fs - the sample rate for the filter
0010 %
0011 %  M Hewitson 03-04-07
0012 %
0013 % $Id: cp2iir.html,v 1.1 2007/06/08 14:15:07 hewitson Exp $
0014 %
0015 
0016 
0017 f0 = get(p, 'f');
0018 q  = get(p, 'q');
0019 
0020 w0 = f0*2*pi;
0021 w02 = w0^2;
0022 
0023 k = (q*w02 + 4*q*fs*fs + 2*w0*fs) / (q*w02);
0024 b(1) = 1;
0025 b(2) = (2*w02-8*fs*fs) / (k*w02);
0026 b(3) = (q*w02 + 4*q*fs*fs - 2*w0*fs) / (k*q*w02);
0027 
0028 a(1) = 1/k;
0029 a(2) = -2/k;
0030 a(3) = -1/k;
0031 a = a*-2;
0032 
0033 % END

Generated on Fri 08-Jun-2007 16:09:11 by m2html © 2003