diff options
author | Nao Pross <np@0hm.ch> | 2021-11-21 10:40:53 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2021-11-21 10:40:53 +0100 |
commit | 2a3b0ef715d83c97ccb0c2b1eb63707a62ffe7a5 (patch) | |
tree | f45e5b6f5ec5a88456d94abc0a63173f355d2571 /tests/fadingui/QAM/hammingtest.py | |
parent | Change chapter title (diff) | |
parent | Merge branch 'master' of github.com:NaoPross/Fading (diff) | |
download | Fading-2a3b0ef715d83c97ccb0c2b1eb63707a62ffe7a5.tar.gz Fading-2a3b0ef715d83c97ccb0c2b1eb63707a62ffe7a5.zip |
Merge branch 'master' of github.com:NaoPross/Fading
Diffstat (limited to 'tests/fadingui/QAM/hammingtest.py')
-rwxr-xr-x | tests/fadingui/QAM/hammingtest.py | 14 |
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)) |