Advanced Analysis Library Only
AnalysisLibErrType InvCh_CascadeCoef (double samplingFreq, double lowerCutoffFreq, double upperCutoffFreq, double stopBandAtten, IIRFilterPtr filterInformation);
Generates the set of cascade form filter coefficients to implement an IIR filter as specified by the inverse Chebyshev filter model.
filterInformation is the pointer to the filter structure that contains the filter coefficients and the internal filter information. You must allocate this structure by calling AllocIIRFilterPtr before you call this cascade IIR filter design function.
To redesign another filter, you should first call FreeIIRFilterPtr to free the present filter structure and then call AllocIIRFilterPtr with the new type and order parameters before you call InvCh_CascadeCoef.
If the type and order remain the same, you can call this IIR design function without calling FreeIIRFilterPtr and AllocIIRFilterPtr. In this case, you must properly reset the filtering operation for that structure by calling ResetIIRFilter before the first call to IIRCascadeFiltering.
/* Design a cascade lowpass inverse Chebyshev IIR filter. */
double fs, fl, fh, atten, x[256], y[256];
int type, order, n;
IIRFilterPtr filterInfo;
n = 256;
fs = 1000.0;
fl = 200.0;
atten = 60.0;
order = 5;
type = 0; /* lowpass */
Uniform(n,17,x);
filterInfo = AllocIIRFilterPtr(type, order);
if(filterInfo!=0) {
InvCh_CascadeCoef(fs, fl, fh, atten, filterInfo);
IIRCascadeFiltering(x, n, filterInfo, y);
FreeIIRFilterPtr(filterInfo);
}
Input | ||
Name | Type | Description |
samplingFreq | double-precision | The sampling frequency in Hertz. |
lowerCutoffFreq | double-precision | The lower cutoff frequency of the filter in Hertz. |
upperCutoffFreq | double-precision | The upper cutoff frequency of the filter in Hertz |
stopBandAtten | double-precision | The stop band attenuation, in decibels, of the IIR filter to design. Default Value: 60.0. |
filterInformation | IIRFilterPtr | Pointer to the filter structure that contains the filter coefficients and the
internal filter information. You must allocate this structure by calling AllocIIRFilterPtr(type,order) before calling this cascade IIR filter design function. |
Name | Type | Description |
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |