mirror of
https://github.com/romanz/amodem.git
synced 2026-02-24 16:18:12 +08:00
test recv.decode()
This commit is contained in:
@@ -5,6 +5,7 @@ from amodem import recv
|
||||
from amodem import train
|
||||
from amodem import sampling
|
||||
|
||||
|
||||
def test_detect():
|
||||
P = sum(train.prefix)
|
||||
t = np.arange(P * config.Nsym) * config.Ts
|
||||
@@ -19,6 +20,7 @@ def test_detect():
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
|
||||
def test_prefix():
|
||||
symbol = np.cos(2 * np.pi * config.Fc * np.arange(config.Nsym) * config.Ts)
|
||||
signal = np.concatenate([c * symbol for c in train.prefix])
|
||||
@@ -34,6 +36,7 @@ def test_prefix():
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
|
||||
def test_find_start():
|
||||
sym = np.cos(2 * np.pi * config.Fc * np.arange(config.Nsym) * config.Ts)
|
||||
|
||||
@@ -47,3 +50,7 @@ def test_find_start():
|
||||
start = recv.find_start(buf, length*config.Nsym)
|
||||
expected = offset + len(prefix)
|
||||
assert expected == start
|
||||
|
||||
|
||||
def test_decode():
|
||||
assert list(recv.decode([])) == []
|
||||
|
||||
Reference in New Issue
Block a user