Elliptic lowpass filter design. The cutoff frequency of an analog filter prototype transformed in to z domain is obtained with BilinearUnwarp method. The analog prototype filter has a normalized cutoff frequency at 1 rad/sec.
uses MtxExpr, Math387, MtxVec, MtxVecTee, MtxVecEdit, LinearSystems, IirFilters, SignalUtils; procedure TForm42.Button1Click(Sender: TObject); var z,p,num,den,Response: Vector; Order: integer; k,Wc: Double; begin Order := 4;//design a fourth order filter. EllipticAnalog(Order,0.1,30,z,p,k); //design analog protype Bilinear(z,p,k,2); //bilinear with sampling frequency 2Hz. Wc := 0.5; //desired cutoff at 0.5 Hz. LowpassToLowpassZ(z,p,k,Wc,BilinearUnwarp(1)); //move cutoff to 0.5 Hz. ZeroPoleToTransferFun(num,den,z,p,k); //Alternative: // ... // ZeroPoleToTransferFun(num,den,z,p,k); // LowpassToLowpassZ(num,den,Wc,BilinearUnwarp(1)); //move cutoff to 0.5 Hz. FrequencyResponse(num,den,Response,64); DrawIt(Response); end;
#include "MtxExpr.hpp" #include "MtxVecEdit.hpp" #include "MtxVecTee.hpp" #include "SignalUtils.hpp" #include "IirFilters.hpp" #include "LinearSystems.hpp" void __fastcall TForm1::BitBtn1Click(TObject *Sender) { sVector z,p,num,den,Response; int Order; double k,Wc; Order = 4;//design a fourth order filter. EllipticAnalog(Order,0.1,30,z,p,k); //design analog protype Bilinear(z,p,k,2); //bilinear with sampling frequency 2Hz. Wc = 0.5; //desired cutoff at 0.5 Hz. LowpassToLowpassZ(z,p,k,Wc,BilinearUnwarp(1)); //move cutoff to 0.5 Hz. ZeroPoleToTransferFun(num,den,z,p,k); //Alternative: // ... // ZeroPoleToTransferFun(num,den,z,p,k); // LowpassToLowpassZ(num,den,Wc,BilinearUnwarp(1)); //move cutoff to 0.5 Hz. FrequencyResponse(num,den,Response,64); DrawIt(Response); }
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
|