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