DSP Master VCL
|
The function returns modified z (zeros), p (poles) and k (gain).
Elliptic highpass filter design. The cutoff frequency of a lowpass 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 TForm1.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. LowpassToHighpassZ(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); // LowpassToHighpassZ(num,den,Wc,BW,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. LowpassToHighpassZ(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); // LowpassToHighpassZ(num,den,Wc,BW,BilinearUnwarp(1)); //move cutoff to 0.5 Hz. FrequencyResponse(num,den,Response,64); DrawIt(Response); }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
|
What do you think about this topic? Send feedback!
|