You are here: Symbol Reference > Dew.Signal Namespace > LinearSystems Class > LinearSystems Methods > ZeroPoleToTransferFun Method
Dew DSP for .NET
Contents
PreviousUpNext
LinearSystems.ZeroPoleToTransferFun Method

Convert transfer function from zero-pole to numerator-denominator form.

C#
public ZeroPoleToTransferFun(TVec num, TVec den, TVec z, TVec p, double k);

Convert a rational polynomial defined with zeros Z and poles P and gain K in to its numerator Num and denominator Den form. The numerator will be scaled by K and both polynomials are assumed to have only real coefficents. (Poles and zeros can still be complex, if they have complex conjugated pairs.)

          num(s)      (s-sz1)*...*(s-szn)
  H(s) = -------- = K*-------------------
          den(s)      (s-sp1)*...*(s-spn)

  szn - n'th zero
  spn - n'th pole
  K - system gain

The following example computes the coefficients of the rational polynomial. The numerator has zeros at 3 and 4 and the denominator has zeros at 1 and 2. The polynomial in zero pole form can be written as:

 (x - 3)*(x - 4)
 ---------------
 (y - 2)*(y - 1)

And in transfer function form:

  x^2 - 7*x + 12
  --------------
  x^2 - 3*x + 2

Notice that powers are falling from left to right. 

 

using Dew.Math;
using Dew.Math.Editors;
using Dew.Math.Units;
using Dew.Signal;
using Dew.Signal.Units;
using Dew.Math.Tee;
using Dew.Signal.Tee;

private void button1_Click(object sender, EventArgs e)
{
   Vector z = new Vector(0);
   Vector p = new Vector(0);
   Vector num = new Vector(0);
   Vector den = new Vector(0);
   double k;

   z.SetIt(false,new double[2] {3,4});
   p.SetIt(false,new double[2] {1,2});
   k = 1;
   LinearSystems.ZeroPoleToTransferFun(num,den,z,p,k);
   MtxVecEdit.ViewValues(num,"Numerator",true);
   MtxVecEdit.ViewValues(den,"Denominator",true);
//        num = [1, -7,  12]
//        den = [1, -3,   2]
}
What do you think about this topic? Send feedback!
Copyright (c) 1999-2010 by Dew Research. All rights reserved.