From 9a6ca77aa469a707eef79006d3af1cda87b76ed0 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Fri, 8 Aug 2014 14:50:07 +0300 Subject: [PATCH] use real part at common.dumps() --- amodem/common.py | 2 +- amodem/sampling.py | 2 +- tests/test_common.py | 2 +- tests/test_full.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/amodem/common.py b/amodem/common.py index cf9e078..65d2df9 100644 --- a/amodem/common.py +++ b/amodem/common.py @@ -47,7 +47,7 @@ def loads(data): def dumps(sym, n=1): - sym = sym.imag * scaling + sym = sym.real * scaling sym = sym.astype('int16') data = sym.tostring() return data * n diff --git a/amodem/sampling.py b/amodem/sampling.py index e55221d..2467002 100755 --- a/amodem/sampling.py +++ b/amodem/sampling.py @@ -76,5 +76,5 @@ if __name__ == '__main__': sampler = Sampler(x, Interpolator()) sampler.freq += df y = np.array(list(sampler)) - y = common.dumps(y*1j) + y = common.dumps(y) sys.stdout.write(y) diff --git a/tests/test_common.py b/tests/test_common.py index 7858fec..cdcd791 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -49,5 +49,5 @@ def test_icapture(): def test_dumps_loads(): x = np.array([.1, .4, .2, .6, .3, .5]) - y = common.loads(common.dumps(x * 1j)) + y = common.loads(common.dumps(x)) assert all(x == y) diff --git a/tests/test_full.py b/tests/test_full.py index 3c1a533..7847a19 100644 --- a/tests/test_full.py +++ b/tests/test_full.py @@ -29,7 +29,7 @@ def run(size, chan): data = tx_audio.getvalue() data = common.loads(data) data = chan(data) - data = common.dumps(data * 1j) + data = common.dumps(data) rx_audio = BytesIO(data) rx_data = BytesIO()