def pwm_encode(data, prefix=None, suffix=None):
    """
        Encode a binary string with PWM:
            https://en.wikipedia.org/wiki/Pulse-width_modulation

        :param data:
        :param prefix:
        :param suffix:
        :return:str
    """
    pwm_bits = [prefix] if prefix is not None else []
    for bit in data:
        pwm_bits.append('100' if bit == '1' else '110')
    if suffix is not None:
        pwm_bits.append(suffix)
    return ''.join(pwm_bits)
