Overload List
| # | Signature | Description |
|---|---|---|
| 1 | procedure Bilinear(const A: TMtx; const B: TVec; const C: TVec; var D: Double; FS: Double); | Apply bilinear transform to a linear system represented in state-space form. |
| 2 | procedure Bilinear(const z: TVec; const p: TVec; var k: Double; FS: Double; AddZeros: Boolean); | Result = bilinear transformation |
Overload 1: procedure Bilinear(const A: TMtx; const B: TVec; const C: TVec; var D: Double; FS: Double);
Apply bilinear transform to a linear system represented in state-space form.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | A | TMtx | |
| 2 | B | TVec | |
| 3 | C | TVec | |
| 4 | D | Double | |
| 5 | FS | Double | scalar |
Result: stored in self (calling object)
Overload 2: procedure Bilinear(const z: TVec; const p: TVec; var k: Double; FS: Double; AddZeros: Boolean);
Compute bilinear transformation.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | z | TVec | |
| 2 | p | TVec | |
| 3 | k | Double | |
| 4 | FS | Double | scalar |
| 5 | AddZeros | Boolean |
Result: stored in self (calling object)
Apply bilinear transform to transfer function represented in zero-pole form. FS defines the sampling frequency. If z.Length < p.Length the routine will not add zeroes at -1 to match the number of poles unless AddZeros is True.
Bilinear transformation is defined with the mapping: s -> 2/T (1 - z^(-1))/(1 + z^(-1)), T = 1/FS Bilinear transform requires that the amplitude response of a continuous system is piecewise constant and can not be used to transform an analog differentiator to a digital filter (for example). Bilinear transform also does not preserve the impulse or the phase response [1].
References:
[1] Theory and application of digital signal processing, Lawrence R. Rabiner and Bernard Gold. Prentice-Hall, 1975
uses MtxExpr, Math387, MtxVec, MtxVecTee, MtxVecEdit,
LinearSystems, IirFilters, SignalUtils;
procedure TForm1.Button1Click(Sender: TObject);
var z,p,num,den, Response,b,c: Vector;
Order: integer;
k,Wc,d: Double;
A: Matrix;
begin
Order := 5; //design a fifth order filter.
EllipticAnalog(Order,0.2,40,z,p,k); //design analog protype
//passband ripple 0.2dB, stopband attenuation 40dB
Bilinear(z,p,k,2); //Sampling frequency = 2
Wc := 0.6; //request a cutoff at 0.6 Hz
LowpassToLowpassZ(z,p,k,WC,BilinearUnwarp(1)); //frequency transformation in z-domain
ZeroPoleToTransferFun(num,den,z,p,k);
//Alternative 1:
// EllipticAnalog(Order,0.2,40,z,p,k); //design analog protype
// Bilinear(z,p,k,2); //Sampling frequency = 2
// ZeroPoleToTransferFun(num,den,z,p,k);
// Wc := 0.6; //request a cutoff at 0.6 Hz
// LowpassToLowpassZ(num,den,WC,BilinearUnwarp(1)); //frequency transformation in z-domain
//Alternative 2:
// EllipticAnalog(Order,0.2,40,z,p,k); //design analog protype
// Wc := BilinearPrewarp(0.6); //request a cutoff at 0.6 Hz
// LowpassToLowpass(z,p,k,WC); //frequency transformation in s-domain
// Bilinear(z,p,k,2); //Sampling frequency = 2
// ZeroPoleToTransferFun(num,den,z,p,k);
//Alternative 3:
// EllipticAnalog(Order,0.2,40,z,p,k); //design analog protype
// ZeroPoleToStateSpace(A,B,C,D,z,p,k);
// Wc := BilinearPrewarp(0.6); //request a cutoff at 0.6 Hz
// LowpassToLowpass(A,B,C,D,WC); //frequency transformation in s-domain
// Bilinear(A,B,C,D,2);
// StateSpaceToZeroPole(z,p,k,A,B,C,D);
// ZeroPoleToTransferFun(num,den,z,p,k);
FrequencyResponse(num,den,Response,64); //zero padding set to 64
DrawIt(Response);
end;