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

An analog lowpass filter is converted to z-domain by using the bilinear transform. The analog filter has a normalized cutoff frequency at 1 rad/sec. This frequency is mapped by the bilinear transformation to the value as returned by the function: BilinearUnwarp(1). To obtain the required cutoff frequency of an analog lowpass filter, which will map to a selected frequency in z-domain use the BilinearPrewarp routine. 

 

uses MtxExpr, Math387, MtxVec, MtxVecTee, MtxVecEdit,
     LinearSystems, IirFilters, SignalUtils;

    procedure TForm1.Button1Click(Sender: TObject);
    var z,p,num,den, Response,b,c: Vector;
        Order: integer;
        k,Wc,d: Double;
        A: Matrix;
    begin
        Order := 5; //design a fifth order filter.

        EllipticAnalog(Order,0.2,40,z,p,k);  //design analog protype
        //passband ripple 0.2dB, stopband attenuation 40dB
        Bilinear(z,p,k,2);  //Sampling frequency  = 2
        Wc := 0.6; //request a cutoff at 0.6 Hz
        LowpassToLowpassZ(z,p,k,WC,BilinearUnwarp(1));  //frequency transformation in z-domain
        ZeroPoleToTransferFun(num,den,z,p,k);

    //Alternative 1:
    //      EllipticAnalog(Order,0.2,40,z,p,k);  //design analog protype
    //      Bilinear(z,p,k,2);  //Sampling frequency  = 2
    //      ZeroPoleToTransferFun(num,den,z,p,k);
    //      Wc := 0.6; //request a cutoff at 0.6 Hz
    //      LowpassToLowpassZ(num,den,WC,BilinearUnwarp(1));  //frequency transformation in z-domain

    //Alternative 2:
    //      EllipticAnalog(Order,0.2,40,z,p,k);  //design analog protype
    //      Wc := BilinearPrewarp(0.6); //request a cutoff at 0.6 Hz
    //      LowpassToLowpass(z,p,k,WC);  //frequency transformation in s-domain
    //      Bilinear(z,p,k,2);  //Sampling frequency  = 2
    //      ZeroPoleToTransferFun(num,den,z,p,k);

    //Alternative 3:
    //      EllipticAnalog(Order,0.2,40,z,p,k);  //design analog protype
    //      ZeroPoleToStateSpace(A,B,C,D,z,p,k);
    //      Wc := BilinearPrewarp(0.6); //request a cutoff at 0.6 Hz
    //      LowpassToLowpass(A,B,C,D,WC); //frequency transformation in s-domain
    //      Bilinear(A,B,C,D,2);
    //      StateSpaceToZeroPole(z,p,k,A,B,C,D);
    //      ZeroPoleToTransferFun(num,den,z,p,k);

            FrequencyResponse(num,den,Response,64); //zero padding set to 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, b, c;
      int Order;
      double k,Wc,d;
      Matrix A;

      Order = 5; //design a fifth order filter.

    //  EllipticAnalog(Order,0.2,40,z,p,k);  //design analog protype
    //  //passband ripple 0.2dB, stopband attenuation 40dB
    //  Bilinear(z,p,k,2);  //Sampling frequency  = 2
    //  Wc = 0.6; //request a cutoff at 0.6 Hz
    //  LowpassToLowpassZ(z,p,k,Wc,BilinearUnwarp(1));  //frequency transformation in z-domain
    //  ZeroPoleToTransferFun(num,den,z,p,k);

    //Alternative 1:
    //    EllipticAnalog(Order,0.2,40,z,p,k);  //design analog protype
    //    Bilinear(z,p,k,2);  //Sampling frequency  = 2
    //    ZeroPoleToTransferFun(num,den,z,p,k);
    //    Wc = 0.6; //request a cutoff at 0.6 Hz
    //    LowpassToLowpassZ(num,den,Wc,BilinearUnwarp(1));  //frequency transformation in z-domain

    //Alternative 2:
    //    EllipticAnalog(Order,0.2,40,z,p,k);  //design analog protype
    //    Wc = BilinearPrewarp(0.6); //request a cutoff at 0.6 Hz
    //    LowpassToLowpass(z,p,k,Wc);  //frequency transformation in s-domain
    //    Bilinear(z,p,k,2);  //Sampling frequency  = 2
    //    ZeroPoleToTransferFun(num,den,z,p,k);

    //Alternative 3:
        EllipticAnalog(Order,0.2,40,z,p,k);  //design analog protype
        ZeroPoleToStateSpace(A,b,c,d,z,p,k);
        Wc = BilinearPrewarp(0.6); //request a cutoff at 0.6 Hz
        LowpassToLowpass(A,b,c,d,Wc); //frequency transformation in s-domain
        Bilinear(A,b,c,d,2);
        StateSpaceToZeroPole(z,p,k,A,b,c,d);
        ZeroPoleToTransferFun(num,den,z,p,k);

        FrequencyResponse(num,den,Response,64); //zero padding set to 64
        DrawIt(Response);
    }
Copyright (c) 1999-2025 by Dew Research. All rights reserved.