Overload List
Overload 1: function ChebyshevIFilter(Order: Integer; PassRipple: Double; CutoffFreq: TDoubleArray; FilterType: TFilterType; Analog: Boolean; A: TMtx; B: TVec; C: TVec; out d: Double): Double;
The resulting transfer function is returned in the state-space form with A,B,C,D variables.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Order | Integer | |
| 2 | PassRipple | Double | scalar |
| 3 | CutoffFreq | TDoubleArray | |
| 4 | FilterType | TFilterType | |
| 5 | Analog | Boolean | |
| 6 | A | TMtx | source TMtx |
| 7 | B | TVec | source TVec |
| 8 | C | TVec | source TVec |
| 9 | d | Double |
Returns: Double
Overload 2: function ChebyshevIFilter(Order: Integer; PassRipple: Double; CutoffFreq: TDoubleArray; FilterType: TFilterType; Analog: Boolean; Num: TVec; Den: TVec; IirFrequencyTransform: TIirFrequencyTransform): Double;
The resulting transfer function is returned in the numerator/denumerator form with num and den.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Order | Integer | |
| 2 | PassRipple | Double | scalar |
| 3 | CutoffFreq | TDoubleArray | |
| 4 | FilterType | TFilterType | |
| 5 | Analog | Boolean | |
| 6 | Num | TVec | source TVec |
| 7 | Den | TVec | source TVec |
| 8 | IirFrequencyTransform | TIirFrequencyTransform |
Returns: Double
Overload 3: function ChebyshevIFilter(Order: Integer; PassRipple: Double; CutoffFreq: TDoubleArray; FilterType: TFilterType; Analog: Boolean; z: TVec; p: TVec; out k: Double; IirFrequencyTransform: TIirFrequencyTransform): Double;
Design Chebyshev type I IIR filter.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Order | Integer | |
| 2 | PassRipple | Double | scalar |
| 3 | CutoffFreq | TDoubleArray | |
| 4 | FilterType | TFilterType | |
| 5 | Analog | Boolean | |
| 6 | z | TVec | source TVec |
| 7 | p | TVec | source TVec |
| 8 | k | Double | |
| 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.
uses MtxExpr, Math387, MtxVec, SignalUtils, MtxVecTee, MtxVecEdit, IirFilters,
LinearSystems;
{$R *.dfm}
procedure TForm42.Button1Click(Sender: TObject);
var z,p, num,den, FreqFr,Response: Vector;
Order: integer;
k,Bw,Wc: double;
WcArray: TDoubleArray; //modified 3dB frequency
begin
SetLength(WcArray,2);
Order := ChebyshevIIOrder([1,2,5,7],0.2,50,ftBandpass,WcArray,True);
ChebyshevIFilter(Order,0.2,WcArray,ftBandpass,true,num,den);
FreqFr.Length := 1000; //Define the frequency grid (logarithmic)
LogRamp(FreqFr,-1,1); //between 0.1 (=10^(-1)) and 10 (=10^1) rad/sec
FrequencyResponseS(num,den,FreqFr,Response); //Laplace
DrawIt(Response); //Y axis linear, X axis logarithmic;
// Alternative: Design a digital filter with the passband between 0.2 and 0.5 Hz (FS =2)
// SetLength(WcArray,2);
// Order := ChebyshevIOrder([0.1,0.2,0.5,0.6],0.2,50,ftBandpass,WcArray,false);
// ChebyshevIFilter(Order,0.2,WcArray,ftBandpass,false,num,den);
// FrequencyResponse(num,den,Response,64);
// FreqFr.Size(Response.Length);
// FreqFr.Ramp(0,1/FreqFr.Length);
// DrawIt(FreqFr,Response);
end;
Overload 4: function ChebyshevIFilter(Order: Integer; PassRipple: Double; CutoffFreq: TDoubleArray; FilterType: TFilterType; Analog: Boolean; sos: TVec; IirFrequencyTransform: TIirFrequencyTransform): Double;
The resulting transfer function is returned in the second order section form stored in the sos variable.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Order | Integer | |
| 2 | PassRipple | Double | scalar |
| 3 | CutoffFreq | TDoubleArray | |
| 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.