|
DSP Master VCL
|
Convert transfer function from zero-pole to numerator-denominator form.
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 gainThe 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.
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;
#include "MtxExpr.hpp"
#include "MtxVecEdit.hpp"
#include "MtxVecTee.hpp"
#include "SignalUtils.hpp"
#include "LinearSystems.hpp"
void __fastcall TForm41::BitBtn1Click(TObject *Sender)
{
sVector z,p,num,den;
double k;
z.Size(2);
z[0] = 3;
z[1] = 4;
p.Size(2);
p[0] = 1;
p[1] = 2;
k = 1;
ZeroPoleToTransferFun(num,den,z,p,k);
ViewValues(num);
ViewValues(den);
// num = [1, -7, 12]
// den = [1, -3, 2]
}
|
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
|
|
What do you think about this topic? Send feedback!
|