You are here: Symbol Reference > LinearSystems Namespace > Functions > LinearSystems.LowpassToBandpassZ Function
DSP Master VCL
ContentsIndex
PreviousUpNext
LinearSystems.LowpassToBandpassZ Function

The function returns modified z (zeros), p (poles) and k (gain).

Pascal
procedure LowpassToBandpassZ(const z: TVec; const p: TVec; var k: Double; Freq: Double; BW: Double; PrototypeFreq: Double); overload;

Elliptic bandpass 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,w1,w2,BW: 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.
        w1 := 0.2; //start of the passband at 0.2Hz.
        w2 := 0.5; //stop of the passband at 0.5Hz.
        Wc := Sqrt(w1*w2); //center frequency of the passband
        BW := w2-w1;  //passband width
    //    LowpassToBandpassZ(z,p,k,Wc,BW,BilinearUnwarp(1));
    //    ZeroPoleToTransferFun(num,den,z,p,k);

    //Alternative:
    //       ...
          ZeroPoleToTransferFun(num,den,z,p,k);
          LowpassToBandpassZ(num,den,Wc,BW,BilinearUnwarp(1));

        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,w1,w2,BW;

        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.
        w1 = 0.2; //start of the passband at 0.2Hz.
        w2 = 0.5; //stop of the passband at 0.5Hz.
        Wc = Sqrt(w1*w2); //center frequency of the passband
        BW = w2-w1;  //passband width
      //    LowpassToBandpassZ(z,p,k,Wc,BW,BilinearUnwarp(1));
      //    ZeroPoleToTransferFun(num,den,z,p,k);

      //Alternative:
      //       ...
          ZeroPoleToTransferFun(num,den,z,p,k);
          LowpassToBandpassZ(num,den,Wc,BW,BilinearUnwarp(1));

        FrequencyResponse(num,den,Response,64);
        DrawIt(Response);
    }
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!