From be31566ff16e657bb831238a6ceb5c60a00de494 Mon Sep 17 00:00:00 2001 From: cmayer Date: Tue, 14 May 2019 16:23:03 +0200 Subject: [PATCH] deinterleaver fix for S4285 2400 baud --- python/physical_layer/STANAG_4285.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/python/physical_layer/STANAG_4285.py b/python/physical_layer/STANAG_4285.py index bfc1a26..93883af 100644 --- a/python/physical_layer/STANAG_4285.py +++ b/python/physical_layer/STANAG_4285.py @@ -27,12 +27,12 @@ MODE_QPSK=1 MODE_8PSK=2 MODES = { ## [BPS]['const'] [BPS]['punct'] [BPS]['repeat'] - '2400': {'const': MODE_8PSK, 'punct': ['11', '10'] , 'repeat': 1}, - '1200': {'const': MODE_QPSK, 'punct': [ '1', '1'] , 'repeat': 1}, - '600': {'const': MODE_BPSK, 'punct': [ '1', '1'] , 'repeat': 1}, - '300': {'const': MODE_BPSK, 'punct': [ '1', '1'] , 'repeat': 2}, - '150': {'const': MODE_BPSK, 'punct': [ '1', '1'] , 'repeat': 4}, - '75': {'const': MODE_BPSK, 'punct': [ '1', '1'] , 'repeat': 8} + '2400': {'const': MODE_8PSK, 'punct': ['11', '10'] , 'repeat': 1, 'deintl_multiple': 4}, + '1200': {'const': MODE_QPSK, 'punct': [ '1', '1'] , 'repeat': 1, 'deintl_multiple': 2}, + '600': {'const': MODE_BPSK, 'punct': [ '1', '1'] , 'repeat': 1, 'deintl_multiple': 1}, + '300': {'const': MODE_BPSK, 'punct': [ '1', '1'] , 'repeat': 2, 'deintl_multiple': 1}, + '150': {'const': MODE_BPSK, 'punct': [ '1', '1'] , 'repeat': 4, 'deintl_multiple': 1}, + '75': {'const': MODE_BPSK, 'punct': [ '1', '1'] , 'repeat': 8, 'deintl_multiple': 1} } DEINTERLEAVER_INCR = { 'S': 1, 'L': 12 } @@ -58,7 +58,7 @@ class PhysicalLayer(object): print('set_mode', mode) bps,intl = mode.split('/') self._mode = MODES[bps]['const'] - self._deinterleaver = Deinterleaver(DEINTERLEAVER_INCR[intl]) + self._deinterleaver = Deinterleaver(DEINTERLEAVER_INCR[intl] * MODES[bps]['deintl_multiple']) self._depuncturer = common.Depuncturer(repeat = MODES[bps]['repeat'], puncture_pattern = MODES[bps]['punct']) @@ -173,7 +173,7 @@ class PhysicalLayer(object): @staticmethod def make_psk(n, gray_code): """generates n-PSK constellation data""" - c = np.zeros(n, dtype=[('points', np.complex64), ('symbols', np.int32)]) + c = np.zeros(n, common.CONST_DTYPE) c['points'] = np.exp(2*np.pi*1j*np.arange(n)/n) c['symbols'] = gray_code return c