public class IirFilterDesignFisher extends Object
This class is based on a Java port of C source code by Anthony J. Fisher.
Modifier and Type | Method and Description |
---|---|
static IirFilterCoefficients |
design(FilterPassType filterPassType,
FilterCharacteristicsType filterCharacteristicsType,
int filterOrder,
double ripple,
double fcf1,
double fcf2)
Designs an IIR filter and returns the IIR filter coefficients.
|
public static IirFilterCoefficients design(FilterPassType filterPassType, FilterCharacteristicsType filterCharacteristicsType, int filterOrder, double ripple, double fcf1, double fcf2)
The cutoff frequencies are specified relative to the sampling rate and must be
between 0 and 0.5.
The following formula can be used to calculate the relative frequency values:
frequencyInHz / samplingRateInHz
For Bessel filters, matched Z-transform is used to design the filter.
filterPassType
- The filter pass type (Lowpass, highpass, bandpass, bandstop).filterCharacteristicsType
- The filter characteristics type.
The following filters are implemented: Butterworth, Chebyshev (type 1), Bessel.filterOrder
- The filter order.ripple
- Passband ripple in dB. Must be negative. Only used for Chebyshev filter, ignored for other filters.fcf1
- The relative filter cutoff frequency for lowpass/highpass, lower cutoff frequency for bandpass/bandstop.
This value is relative to the sampling rate (see above for more details).fcf2
- Ignored for lowpass/highpass, the relative upper cutoff frequency for bandpass/bandstop,
This value is relative to the sampling rate (see above for more details).