procedure MatchedZTransform(const z: TVec; const p: TVec; FS: Double);
Transform the zeros and poles of a filter in s-domain to z-domain.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | z | TVec | |
| 2 | p | TVec | |
| 3 | FS | Double | scalar |
Result: stored in self (calling object)
Remarks:
Transform the zeros Z and poles P of a filter from s-domain to z-domain, where FS is the sampling frequency. The transformation is defined as ([1], p. 224): s + a -> 1 - z^(-1)e^(-a/FS)
FS - sampling frequency a - pole or zero
If the analog system has zeros with center frequencies greater then half the sampling frequency, their z-plane positions will be greatly aliased [1]. The transformation has the advantage of not affecting the phase response of the original transfer function.
References:
[1] Theory and application of digital signal processing, Lawrence R. Rabiner and Bernard Gold. Prentice-Hall, 1975
Examples
uses MtxExpr, Math387, MtxVec, MtxVecTee, MtxVecEdit,
LinearSystems, IirFilters, SignalUtils;
procedure TForm1.Button1Click(Sender: TObject);
var z,p, num,den, FreqFr,Response: Vector;
Order: integer;
k,Wc,BW: Double;
begin
Order := 5; //design a fifth order filter.
BesselAnalog(Order,z,p,k); //design analog protype
Wc := 0.5; //request a cutoff at 0.5 rad/sec
LowpassToLowpass(z,p,k,Wc);
MatchedZTransform(z,p,2); //Sampling frequency = 2
k := k/ComputeGain(z,p,1);
z.Size(p.Length,false);
z.SetVal(-1); //add missing zeros at -1
ZeroPoleToTransferFun(num,den,z,p,k);
FrequencyResponse(num,den,Response,64); //zero padding set to 64
DrawIt(20*Log10(Abs(Response)),'Magnitude');
DrawIt(PhaseSpectrum(Response)*(180/Pi),'Phase');
end;
See Also: LinearSystems.Bilinear