def beta_from_As(As):
    """
    Find beta given the stopband attenuation (in dB)

    Parameters
    ----------
    As : float
        Stopband attenuation in dB

    Returns
    -------
    beta : float
        The computed beta

    This is a standard formula from Kaiser."""
    if As > 50:
        return 0.1102 * (As - 8.7)
    elif As > 21:
        return 0.5842 * (As - 21) ** 0.4 + 0.07886 * (As - 21)
    else:
        return 0.0
