def get_closest_multiple_of_16(num):
    """
    Compute the nearest multiple of 16. Needed because pulse enabled devices require
    durations which are multiples of 16 samples.
    """
    return int(num) - (int(num) % 16)