elif rate > 16:
            rate = 16
        else:  # make sure rate is a power of 2
            rate = 2 ** nextpow2(rate)