procedure ZeroPoleToTransferFun(const Num: TVec; const Den: TVec; const z: TVec; const p: TVec; k: Double);
Convert transfer function from zero-pole to numerator-denominator form.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Num | TVec | |
| 2 | Den | TVec | |
| 3 | z | TVec | |
| 4 | p | TVec | |
| 5 | k | Double | scalar |
Result: stored in self (calling object)
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 gainExamples
uses MtxExpr, Math387, MtxVec, MtxVecTee, MtxVecEdit, LinearSystems;
procedure TForm1.Button1Click(Sender: TObject);
var z,p,num,den: Vector;
k: Double;
begin
z.SetIt(false,[3,4]);
p.SetIt(false,[1,2]);
k := 1;
ZeroPoleToTransferFun(num,den,z,p,k);
ViewValues(num);
ViewValues(den);
// num = [1, -7, 12]
// den = [1, -3, 2]
end;