OptimalFir.RemezFirLength Method

Int32 RemezFirLength(Double[] W, Double Ripple, TFilterType FilterType, Double FS)

Estimate the number of taps of an optimal equiripple FIR filter.

#NameDescription
1WTransition-band edge frequencies (2 or 4 values), relative to FS.
2RippleMaximum allowed linear passband ripple
3also sets the stopband attenuation as 20 log_(10)(Ripple). Must be positive.
4FilterTypeFilter class (lowpass, highpass, bandpass, bandstop, ...).
5FSSampling frequency used to normalise W
6default 2.

Returns: Int32 - The estimated filter length (>= 3, <= MaxFirLength).

Remarks:

Returns an estimate of the filter length (number of impulse-response coefficients) needed for a Parks-McClellan design that achieves at most Ripple in the passband over the transition geometry in W. The requested stopband attenuation in dB is taken to be A_(stop) = 20 log_(10)(Ripple) , and the length grows as the transition band narrows and as Ripple decreases. The W array holds two (lowpass/highpass) or four (bandpass/bandstop) edge frequencies giving the start and stop of each transition band, expressed relative to FS. The result is clamped to at least 3 and never exceeds the MaxFirLength global. For filter types whose response is non-zero at the Nyquist frequency the length is forced odd.

Note: this is a simplified front end to RemezLength (which additionally fills the per-band error weights).

See Also: OptimalFir.RemezLength, OptimalFir.RemezImpulse, SignalUtils.KaiserFirLength, SignalUtils.KaiserImpulse, SignalUtils.FirImpulse