You are here: Symbol Reference > Dew.Signal Namespace > IIRFilters Class > IIRFilters Methods > ChebyshevIIFilter Method > ChebyshevIIFilter Method (integer, TSample, array of TSample, TFilterType, boolean, TMtx, TVec, TVec, TSample)
Dew DSP for .NET
Contents
PreviousUpNext
IIRFilters.ChebyshevIIFilter Method (integer, TSample, array of TSample, TFilterType, boolean, TMtx, TVec, TVec, TSample)

The resulting transfer function is returned in the state-space form with A,B,C,D variables.

C#
public double ChebyshevIIFilter(int Order, double StopRipple, double[] CutoffFreq, TFilterType FilterType, bool Analog, TMtx A, TVec B, TVec C, ref double d);

Design a discrete highpass filter with transition band between 10..12 Hz, if the sampling frequency is 30 Hz. The stopband should have more then 50 dB attenuation and the passband should not have more then 0.2dB ripple.

using Dew.Math;
using Dew.Math.Editors;
using Dew.Math.Units;
using Dew.Signal;
using Dew.Signal.Units;
using Dew.Math.Tee;
using Dew.Signal.Tee;

private void button1_Click(object sender, EventArgs e)
{
    Vector z = new Vector(0);
    Vector p = new Vector(0);
    Vector num = new Vector(0);
    Vector den = new Vector(0);
    Vector Response = new Vector(0);

    double[] WcArray = new double[1];
    int Order; //design a fifth order filter.

    Order = IIRFilters.ChebyshevIIOrder(new double[2] { 10.0/30, 12.0/30 }, 0.2, 50, TFilterType.ftHighPass, ref WcArray, false);  //design analog protype
    IIRFilters.ChebyshevIIFilter(Order, 50, WcArray, TFilterType.ftHighPass, false, num, den, TIirFrequencyTransform.ftStateSpaceAnalog);

    SignalUtils.FrequencyResponse(num, den, Response, 32, false, TSignalWindowType.wtRectangular, 0);

    Vector FreqFr = MtxExpr.Ramp(Response.Length, 0, 1.0 / Response.Length); //X axis
    TeeChart.DrawIt(FreqFr, Response, "Frequency response", false);
}
What do you think about this topic? Send feedback!
Copyright (c) 1999-2010 by Dew Research. All rights reserved.