int RemezFirLength(const DewArray<double> &W, double Ripple, TFilterType FilterType, double FS = 2);
Estimate the number of taps of an optimal equiripple FIR filter.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | W | const DewArray<double> & | Transition-band edge frequencies (2 or 4 values), relative to FS. |
| 2 | Ripple | double | Maximum allowed linear passband ripple; also sets the stopband attenuation as 20 log_(10)(Ripple). Must be positive. |
| 3 | FilterType | TFilterType | Filter class (lowpass, highpass, bandpass, bandstop, ...). |
| 4 | FS = 2 | double | Sampling frequency used to normalise W; default 2. |
Returns: The estimated filter length (>= 3, <= MaxFirLength).
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).