aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fadingui/QAM/hammingtest.py
blob: b72e386920dd816747faa66c157969408629383a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python3
import numpy as np
from fadingui import frame_obj

f = frame_obj([1,0], 10)
q = np.random.randint(0, 2, size=26)

parity = f.parity(q)
enc = np.concatenate([q, parity])

print(q)
print(parity)
print(enc)
print(f.syndrome(enc))