From 4590a8de5c6054a82cec983e078fd73e9bc72744 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sun, 24 Aug 2014 19:17:44 +0300 Subject: [PATCH] test dsp.Demux --- tests/test_dsp.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_dsp.py b/tests/test_dsp.py index e7bd1b1..4c8022c 100644 --- a/tests/test_dsp.py +++ b/tests/test_dsp.py @@ -86,3 +86,13 @@ def test_estimate(): y_ = dsp.lfilter(b=h_, a=[1], x=x) assert norm(y - y_) < 1e-12 + + +def test_demux(): + freqs = [1e3, 2e3] + carriers = [dsp.exp_iwt(f, config.Nsym) for f in freqs] + syms = [3, 2j] + sig = np.dot(syms, carriers) + res = dsp.Demux(sig.real, freqs) + res = np.array(list(res)) + assert np.max(np.abs(res - syms)) < 1e-12