Sunday, July 24, 2016

Nasty Python Code

~/Documents/Python/SoftwareReceiverDesign/pam_generator.py.html
import numpy as np
import itertools

def letters2pam(s):
        return list(itertools.chain(*[[int(pair[0] + pair[1],2)*2-3 for pair in np.reshape(list('{:08b}'.format(ord(c))),(4,2))]  for c in s]))


No comments:

Post a Comment