Home > classes > @pzmodel > private > pzm2ab.m

pzm2ab

PURPOSE ^

FILTER2AB convert pzmodel to IIR filter coefficients using bilinear

SYNOPSIS ^

function [ao,bo] = pzm2ab(pzm, fs)

DESCRIPTION ^

 FILTER2AB convert pzmodel to IIR filter coefficients using bilinear
 transform.
 
 usage: [a,b] = pzm2ab(pzm, fs)
 
 M Hewitson 03-04-07
 
 $Id: pzm2ab.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 [ao,bo] = pzm2ab(pzm, fs)
0002 % FILTER2AB convert pzmodel to IIR filter coefficients using bilinear
0003 % transform.
0004 %
0005 % usage: [a,b] = pzm2ab(pzm, fs)
0006 %
0007 % M Hewitson 03-04-07
0008 %
0009 % $Id: pzm2ab.html,v 1.1 2007/06/08 14:15:07 hewitson Exp $
0010 %
0011 
0012 
0013 gain  = get(pzm, 'gain');
0014 poles = get(pzm, 'poles');
0015 zeros = get(pzm, 'zeros');
0016 np = length(poles);
0017 nz = length(zeros);
0018 
0019 ao = [];
0020 bo = [];
0021 
0022 for j=1:np
0023   pole = poles(j);
0024   if get(pole, 'q') > 0.5
0025     [ai,bi] = cp2iir(pole, fs);
0026   else
0027     [ai,bi] = rp2iir(pole, fs);
0028   end
0029   if ~isempty(ao)>0
0030     [ao,bo] = abcascade(ao,bo,ai,bi);
0031   else
0032     ao = ai;
0033     bo = bi;
0034   end
0035 end
0036 
0037 for j=1:nz
0038   zero = zeros(j);
0039   if get(zeros, 'q') > 0.5
0040     [ai,bi] = cz2iir(zero, fs);
0041   else
0042     [ai,bi] = rz2iir(zero, fs);
0043   end
0044   if ~isempty(ao)>0
0045     [ao,bo] = abcascade(ao,bo,ai,bi);
0046   else
0047     ao = ai;
0048     bo = bi;
0049   end
0050 end
0051 
0052 ao = ao.*gain;
0053 
0054 % END

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