public class IirFilterDesignExstrom extends Object
This class is a Java port of the C source code from www.exstrom.com/journal/sigproc.
Note that, although there is no upper limit on the filter order, if the bandwidth of a bandpass or bandstop filter is small, the coefficients returned may not give the desired response due to numerical instability in the calculation. For small bandwidths you should always verify the frequency response using a program that calculates the frequency response out of the calculated filter coefficients. (see TestIirFilterTransferPlotExstrom.java)
Modifier and Type | Method and Description |
---|---|
static IirFilterCoefficients |
design(FilterPassType filterPassType,
int filterOrder,
double fcf1,
double fcf2)
Designs a Butterworth filter and returns the IIR filter coefficients.
|
public static IirFilterCoefficients design(FilterPassType filterPassType, int filterOrder, 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
filterPassType
- The filter pass type (lowpass, highpass, bandpass or bandstop).filterOrder
- The filter order.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).