Modulation and demodulation of digital signals