This commit is contained in:
Roman Zeyde
2014-07-12 14:21:30 +03:00
parent 1a0175c975
commit cb28d33908
2 changed files with 4 additions and 5 deletions

View File

@@ -4,12 +4,10 @@ import numpy as np
def test_resample():
x = np.arange(300)
s = sampling.Sampler(x, )
s = sampling.Sampler(x)
y = np.array(list(s))
w = s.interp.width
x = x[w-1:-w]
err = x - y
err = x[1:len(y)+1] - y
assert np.max(np.abs(err)) < 1e-10

View File

@@ -8,7 +8,8 @@ import random
def test_qam():
q = sigproc.QAM(common.symbols)
r = random.Random(0)
bits = [tuple(r.randint(0, 1) for j in range(4)) for i in range(1024)]
m = q.bits_per_symbol
bits = [tuple(r.randint(0, 1) for j in range(m)) for i in range(1024)]
stream = itertools.chain(*bits)
S = q.encode(list(stream))
decoded = list(q.decode(list(S)))