Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Partial Fraction Expansion: residued.m

Figure J.6 gives a listing of a matlab function for computing a ``right justified'' partial fraction expansion (PFE) of an IIR digital filter $ H(z)=B(z)/A(z)$ as described in §6.8 (and below).

The code in Fig.J.6 was written for Octave, and should also work in Matlab if the 'e' output argument containing pole multiplicities is omitted (in two places).

Figure J.6: Matlab/Octave function for computing a partial fraction expansion in which the parallel sections follow the FIR part.

function [r, p, f, e] = residued(b, a, toler)
if nargin<3, toler=0.001; end
NUM = b(:)';
DEN = a(:)';
nb = length(NUM);
na = length(DEN);
f = [];
if na<=nb
  f = filter(NUM,DEN,[1,zeros(nb-na)]);
  NUM = NUM - conv(DEN,f);
  NUM = NUM(nb-na+2:end);
[r,p,f2,e] = residuez(NUM,DEN,toler);

Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

[How to cite this work]  [Order a printed hardcopy]  [Comment on this page via email]

``Introduction to Digital Filters with Audio Applications'', by Julius O. Smith III, (September 2007 Edition).
Copyright © 2014-03-23 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University