IIRFilters::ButterOrder Function

int ButterOrder(const DewArray<double> &BEdges, double PassRipple, double StopRipple, TFilterType FilterType, DewArray<double> &CutoffFreq, bool Analog = false);

Estimate the minimum Butterworth filter order that meets a transition-band specification, and fill CutoffFreq with the natural (3 dB) cutoff(s). BEdges holds the band edges in ascending order (passband edge then stopband edge per band); PassRipple (R_p dB) and StopRipple (R_s dB) bound the passband ripple and stopband attenuation. The returned order is n=\lceil(log_(10)(10^(R_s/10)-1)/(10^(R_p/10)-1))/(2 log_(10)(omega_s/omega_p))\rceil, capped at MaxIirOrder (=50). CutoffFreq length must be half BEdges length and match FilterType (1 value for lp/hp, 2 for bp/bs). Domain: digital edges lie in (0,1)(0,1) with sampling frequency 2 (Analog=False); analog edges are in rad/s (Analog=True). NOTE: the natural cutoff placement differs slightly from scipy buttord (same integer order, the 3 dB frequency may differ by under 1 percent).

#NameTypeDescription
1BEdgesconst DewArray<double> &
2PassRippledouble
3StopRippledouble
4FilterTypeTFilterType
5CutoffFreqDewArray<double> &
6Analog = falsebool
Remarks:

Returns the order of a butterworth type IIR filter. Bedg array must contain the band edges of the transition region(s) sorted in ascending order. PassRipple defines the ripple of the passband and StopRipple defines the ripple of the stopband. The length of the CutoffFreq array must be equal to one half of the length of the BEdg array and must match the specified FilterType. The routine returns the estimated order as a result and fill's the CutoffFreq array. This array can then be passed to the ButterFilter routine.

See Also: IIRFilters::ButterFilter
Declared in Dew::Signal::Units::IIRFilters · Dew.Signal/Units.IIrFilters.h · Cross-compiler