use equalization at receiver

This commit is contained in:
Roman Zeyde
2014-08-28 14:25:50 +03:00
parent 5735533a3b
commit 1952ac31c3
2 changed files with 75 additions and 61 deletions

View File

@@ -20,8 +20,7 @@ def test_detect():
pass
def test_prefix():
t = np.arange(config.Nsym) * config.Ts
symbol = np.cos(2 * np.pi * config.Fc * t)
symbol = np.cos(2 * np.pi * config.Fc * np.arange(config.Nsym) * config.Ts)
signal = np.concatenate([c * symbol for c in train.prefix])
sampler = sampling.Sampler(signal)
@@ -34,3 +33,17 @@ def test_prefix():
assert False
except ValueError:
pass
def test_find_start():
sym = np.cos(2 * np.pi * config.Fc * np.arange(config.Nsym) * config.Ts)
length = 200
prefix = postfix = np.tile(0 * sym, 50)
carrier = np.tile(sym, length)
for offset in range(10):
prefix = [0] * offset
bufs = [prefix, prefix, carrier, postfix]
buf = np.concatenate(bufs)
start = recv.find_start(buf, length*config.Nsym)
expected = offset + len(prefix)
assert expected == start