@cache(level=<NUM_LIT:10>)<EOL>def window_bandwidth(window, n=<NUM_LIT:1000>):
if hasattr(window, '<STR_LIT>'):<EOL><INDENT>key = window.__name__<EOL><DEDENT>else:<EOL><INDENT>key = window<EOL><DEDENT>if key not in WINDOW_BANDWIDTHS:<EOL><INDENT>win = get_window(window, n)<EOL>WINDOW_BANDWIDTHS[key] = n * np.sum(win**<NUM_LIT:2>) / np.sum(np.abs(win))**<NUM_LIT:2><EOL><DEDENT>return WINDOW_BANDWIDTHS[key]<EOL>
Get the equivalent noise bandwidth of a window function.


    Parameters
    ----------
    window : callable or string
        A window function, or the name of a window function.
        Examples:
        - scipy.signal.hann
        - 'boxcar'

    n : int > 0
        The number of coefficients to use in estimating the
        window bandwidth

    Returns
    -------
    bandwidth : float
        The equivalent noise bandwidth (in FFT bins) of the
        given window function

    Notes
    -----
    This function caches at level 10.

    See Also
    --------
    get_window