aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fadingui/QAM/hammingtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fadingui/QAM/hammingtest.py')
-rwxr-xr-xtests/fadingui/QAM/hammingtest.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/fadingui/QAM/hammingtest.py b/tests/fadingui/QAM/hammingtest.py
new file mode 100755
index 0000000..b72e386
--- /dev/null
+++ b/tests/fadingui/QAM/hammingtest.py
@@ -0,0 +1,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))