import struct import numpy as np # Tools to read the generated pattern files and the hex output files def readQ31Pattern(r): l = [] with open(r, 'r') as f: f.readline() nb = int(f.readline()) for i in range(nb): f.readline() # Read the hex and interpret the sign r=int(f.readline(),16) r=struct.unpack('