def check_nbits(nbits):
    """Given a number of bits per sample check to make sure
    `filterbank.py` can cope with it.

    Parameters
    ----------
    nbits : int
        Number of bits per sample, as recorded in the filterbank file's
        header.

    Raises
    ------
    ValueError
        If `filterbank.py` cannot cope.

    """
    if nbits not in [32, 16, 8]:
        raise ValueError(
            '`filterbank.py` only supports files with 8- or 16-bit integers, or 32-bit floats (nbits provided: {})!'
            .format(nbits))
