LinearSystems::ZeroPoleToTransferFun Function

void ZeroPoleToTransferFun(TVec *Num, TVec *Den, TVec *z, TVec *p, double k);

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

#NameTypeDescription
1NumTVec *
2DenTVec *
3zTVec *
4pTVec *
5kdouble
Remarks:

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
Examples
#include "MtxExpr.h"
#include "Units.LinearSystems.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Signal;
using namespace Dew::Signal::Units::LinearSystems;

void Example()
{
    Vector z(0);
    Vector p(0);
    Vector num(0);
    Vector den(0);
    double k;

    z.SetIt(false, DewArray<double>{3, 4});
    p.SetIt(false, DewArray<double>{1, 2});
    k = 1;
    ZeroPoleToTransferFun(num, den, z, p, k);
    //        num = [1, -7,  12]
    //        den = [1, -3,   2]
}
See Also: LinearSystems::ZeroPoleToStateSpace, LinearSystems::StateSpaceToTransferFun, LinearSystems::StateSpaceToZeroPole, LinearSystems::TransferFunToZeroPole
Declared in Dew::Signal::Units::LinearSystems · Dew.Signal/Units.LinearSystems.h · Cross-compiler