4
$\begingroup$

When designing an FIR filter using the windowing method, how can one estimate the filter order ? It's obvious that the type of window and the transitions band's width has some effect on the order.

$\endgroup$
4
$\begingroup$

There are only heuristic formulas for estimating the filter order. For a Kaiser window (which is probably the most frequently used window for filter design) the required filter order can be estimated from [1]

$$M=\frac{A-8}{2.285\,\Delta\omega}\tag{1}$$

where $A=-20\log\delta$ ($\delta$ is the maximum deviation from the desired response), and $\Delta\omega$ is the (smallest) transition bandwidth. This formula is of course only valid for the approximation of ideal frequency selective filters (low pass, high pass, etc.). This formula is implemented in Matlab's kaiserord.m function.

[1] Oppenheim, Schafer, Buck, Discrete-Time Signal Processing, 2nd ed., p. 476

$\endgroup$
  • $\begingroup$ i dunno why, but when i look at the MATLAB page, it shows $A-7.95$ in the numerator. not a big difference, but a curiosity. $\endgroup$ – robert bristow-johnson Feb 15 '17 at 19:32
  • $\begingroup$ @robertbristow-johnson: Maybe that was Kaiser's original formula, and Oppenheim / Schafer "improved" it; my kaiserord.m (octave) actually uses $A-8$; don't know about Matlab's current implementation. $\endgroup$ – Matt L. Feb 15 '17 at 19:54
  • $\begingroup$ the other numbers are exactly the same. i know in that $\beta$ formula that one constant is the reciprocal of the number of dB per neper. and, even though it's partly heuristic, i think there's gotta be something to the 2.285 number. $\endgroup$ – robert bristow-johnson Feb 16 '17 at 2:47
  • $\begingroup$ what's interesting is that while the Kaiser window does not provide for a difference in passband ripple $\delta_p$ and stopband ripple $\delta_s$, it can be compared to the O&S formula for FIR length for the Parks-McClellan. $$ $$ Kaiser: $ M=\frac{-10\log_{10}(\delta_s^2) - 8}{2.285\, \Delta\omega}$ $$ $$ Parks-McClellan: $M=\frac{-10\log_{10}(\delta_s \delta_p) - 13}{2.324\, \Delta\omega}$ $$ $$where $M+1$ is the number of taps. you can see that the P-McC does just a little better than the Kaiser (because dividing by 2.324 gets you fewer taps than dividing by 2.285), but is comparable. $\endgroup$ – robert bristow-johnson Feb 16 '17 at 4:20
  • $\begingroup$ @robertbristow-johnson: Yeah, but for a windowing method, Kaiser does pretty well because for a given maximum error $\delta$ you can't do better than PMcC, which, as an iterative method, is of course much more complex than windowing. $\endgroup$ – Matt L. Feb 16 '17 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.