def frequency(freq):
    """ Calculates the bytes for a given frequency """
    freq = (freq << 19) // 32000000

    highest = (freq >> 16) & 0xff
    middle = (freq >> 8) & 0xff
    lowest = (freq >> 0) & 0xff
    return lowest, middle, highest