# What is the relation of the transition band's width and the filter order for the FIR windowing method

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.

## 1 Answer

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

• 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. – robert bristow-johnson Feb 15 '17 at 19:32
• @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. – Matt L. Feb 15 '17 at 19:54
• 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. – robert bristow-johnson Feb 16 '17 at 2:47
• 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. – robert bristow-johnson Feb 16 '17 at 4:20
• @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. – Matt L. Feb 16 '17 at 12:37