mirror of
https://github.com/romanz/amodem.git
synced 2026-03-20 01:06:04 +08:00
refactor sigproc
This commit is contained in:
10
test_sigproc.py
Normal file
10
test_sigproc.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import sigproc
|
||||
import itertools
|
||||
|
||||
def test_qam():
|
||||
q = sigproc.QAM(bits_per_symbol=8, radii=[0.25, 0.5, 0.75, 1.0])
|
||||
bits = [(1,1,0,1,0,0,1,0), (0,1,0,0,0,1,1,1)]
|
||||
stream = itertools.chain(*bits)
|
||||
S = q.encode(list(stream))
|
||||
decoded = list(q.decode(list(S)))
|
||||
assert decoded == bits
|
||||
Reference in New Issue
Block a user