Overload List
Overload 1: Double ChebyshevIFilter(Int32 Order, Double PassRipple, Double[] CutoffFreq, TFilterType FilterType, Boolean Analog, TMtx A, TVec B, TVec C, ref Double d)
The resulting transfer function is returned in the state-space form with A,B,C,D variables.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Order | Int32 | |
| 2 | PassRipple | Double | scalar |
| 3 | CutoffFreq | Double[] | |
| 4 | FilterType | TFilterType | |
| 5 | Analog | Boolean | |
| 6 | A | TMtx | source TMtx |
| 7 | B | TVec | source TVec |
| 8 | C | TVec | source TVec |
| 9 | d | Double (ref) | output |
Returns: Double
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 num = new Vector(0);
Vector den = new Vector(0);
Vector Response = new Vector(0);
Vector FreqFr = new Vector(0);
double[] WcArray= new double[2];
//design analog filter
int Order = IIRFilters.ChebyshevIOrder(new double[4] { 1, 2, 5, 7 }, 0.2, 50, TFilterType.ftBandpass, ref WcArray, true);
IIRFilters.ChebyshevIFilter(Order, 50, WcArray, TFilterType.ftBandpass, true, num,den, TIirFrequencyTransform.ftStateSpaceAnalog); //design analog protype
FreqFr.Length = 1000;
SignalUtils.LogRamp(FreqFr, -1, 1);
SignalUtils.FrequencyResponseS(num, den, FreqFr, Response, 0);
MtxVecTee.DrawIt(Response, "Frequency response", false);
//Alternative: Design a digital filter with the passband between 0.2 and 0.5 Hz (FS =2)
//Order = IIRFilters.ChebyshevIOrder(new double[4] { 0.1, 0.2, 0.5, 0.6 }, 0.2, 50, TFilterType.ftBandpass, ref WcArray, false);
//IIRFilters.ChebyshevIFilter(Order, 50, WcArray, TFilterType.ftBandpass, false, num, den, TIirFrequencyTransform.ftStateSpaceAnalog); //design digital protype
//FrequencyResponse(num,den,Response,64);
//FreqFr = MtxExpr.Ramp(Response.Length, TMtxFloatPrecision.mvDouble, 0, 1.0 / Response.Length);
//MtxVecTee.DrawIt(FreqFr, Response, "Frequency response", false);
}
Overload 2: Double ChebyshevIFilter(Int32 Order, Double PassRipple, Double[] CutoffFreq, TFilterType FilterType, Boolean Analog, TVec Num, TVec Den, TIirFrequencyTransform IirFrequencyTransform)
The resulting transfer function is returned in the numerator/denumerator form with num and den.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Order | Int32 | |
| 2 | PassRipple | Double | scalar |
| 3 | CutoffFreq | Double[] | |
| 4 | FilterType | TFilterType | |
| 5 | Analog | Boolean | |
| 6 | Num | TVec | source TVec |
| 7 | Den | TVec | source TVec |
| 8 | IirFrequencyTransform | TIirFrequencyTransform |
Returns: Double
Overload 3: Double ChebyshevIFilter(Int32 Order, Double PassRipple, Double[] CutoffFreq, TFilterType FilterType, Boolean Analog, TVec z, TVec p, ref Double k, TIirFrequencyTransform IirFrequencyTransform)
Design Chebyshev type I IIR filter.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Order | Int32 | |
| 2 | PassRipple | Double | scalar |
| 3 | CutoffFreq | Double[] | |
| 4 | FilterType | TFilterType | |
| 5 | Analog | Boolean | |
| 6 | z | TVec | source TVec |
| 7 | p | TVec | source TVec |
| 8 | k | Double (ref) | output |
| 9 | IirFrequencyTransform | TIirFrequencyTransform |
Returns: Double
Design Chebyshev type I filter of Order with CutoffFreq frequencies and of FilterType type. Set Analog to True, to request and analog filter design in s-plane or set it to false to obtain a digital filter design in z-plane. PassRipple defines the passband ripple in dB. The CutoffFreq must be in range between 0 and 1 (Sampling frequency = 2) in case of a digital filter design.
IIrFrequencyTransform specifies when and how will the frequency band transformation be applied. The resulting transfer function is returned in the zero-pole form, with z,p,k variables.
Overload 4: Double ChebyshevIFilter(Int32 Order, Double PassRipple, Double[] CutoffFreq, TFilterType FilterType, Boolean Analog, TVec sos, TIirFrequencyTransform IirFrequencyTransform)
The resulting transfer function is returned in the second order section form stored in the sos variable.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Order | Int32 | |
| 2 | PassRipple | Double | scalar |
| 3 | CutoffFreq | Double[] | |
| 4 | FilterType | TFilterType | |
| 5 | Analog | Boolean | |
| 6 | sos | TVec | source TVec |
| 7 | IirFrequencyTransform | TIirFrequencyTransform |
Returns: Double
The sos variable can be passed directly to the IirInitBQ filter initialization routine. Second order section form delivers substantially higher numerical stability and range than filtering with num/den form which is used by the IirInit routine.