def kaiserord(ripple, width):
A = abs(ripple)  <EOL>if A < <NUM_LIT:8>:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % A)<EOL><DEDENT>beta = kaiser_beta(A)<EOL>numtaps = (A - <NUM_LIT>) / <NUM_LIT> / (np.pi * width) + <NUM_LIT:1><EOL>return int(ceil(numtaps)), beta<EOL>
Design a Kaiser window to limit ripple and width of transition region.

Parameters
----------
ripple : float
    Positive number specifying maximum ripple in passband (dB) and minimum
    ripple in stopband.
width : float
    Width of transition region (normalized so that 1 corresponds to pi
    radians / sample).

Returns
-------
numtaps : int
    The length of the kaiser window.
beta : float
    The beta parameter for the kaiser window.

See Also
--------
kaiser_beta, kaiser_atten

Notes
-----
There are several ways to obtain the Kaiser window:

- ``signal.kaiser(numtaps, beta, sym=0)``
- ``signal.get_window(beta, numtaps)``
- ``signal.get_window(('kaiser', beta), numtaps)``

The empirical equations discovered by Kaiser are used.

References
----------
Oppenheim, Schafer, "Discrete-Time Signal Processing", p.475-476.