procedure EllipticAnalog(Order: Integer; PassRipple: Double; StopRipple: Double; z: TVec; p: TVec; out k: Double);
Design an analog elliptic (Cauer) lowpass prototype filter of order Order, equiripple in BOTH bands (PassRipple dB passband, StopRipple dB stopband), cutoff fixed at 1 rad/s. Returns zero-pole-gain with finite imaginary-axis zeros: |H(jomega)|^2=1/(1+varepsilon^2 R_n^2(omega,xi)), varepsilon=sqrt(10^(R_p/10)-1), where R_n is the Chebyshev rational (elliptic) function. For a given order the elliptic design gives the narrowest transition band of the five families. At the passband edge omega=1 the magnitude equals 10^(-R_p/20). Domain: 1 <= Order <= MaxIirOrder, PassRipple>0, StopRipple>PassRipple (dB). Poles satisfy Re(p_k)<0 (stable). z and p must share precision or an exception is raised.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Order | Integer | |
| 2 | PassRipple | Double | scalar |
| 3 | StopRipple | Double | scalar |
| 4 | z | TVec | source TVec |
| 5 | p | TVec | source TVec |
| 6 | k | Double |
Result: stored in self (calling object)
Design analog elliptic prototype filter of order Order. Place the resulting transfer function in zero-pole form in Z (zeros), P (poles) and K (gain). PassRipple defines the ripple (dB) of the passband and StopRipple defines the ripple of the stopband (dB). The cutoff frequency of the prototype filter is preset to 1 rad/sec. For pole and zero specifications see [1] p. 187.
References:
[1] Digital Filter Design, T.W.Parks and C.S.Burrs, John Wiley and Sons, 1987.
uses MtxExpr, Math387, MtxVec, SignalUtils, MtxVecTee, MtxVecEdit, IirFilters,
LinearSystems;
procedure TForm42.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.
EllipticAnalog(Order,0.1,20,z,p,k); //design analog protype
Wc := Sqrt(1*3);
BW := 3-1;
LowpassToBandstop(z,p,k,Wc,BW); //frequency transformation in s-domain
ZeroPoleToTransferFun(num,den,z,p,k);
FreqFr.Length := 1000; //Define the frequency grid (logarithmic)
LogRamp(FreqFr,-1,1); //between 0.1 (=10^(-1)) and 10 (=10^1) rad/sec
FrequencyResponseS(num,den,FreqFr,Response); //Laplace
DrawIt(Response); //Y axis linear, X axis logarithmic;
end;