From 7715a032ab686f10e6a35fa18dbdc9a90ce7e0d7 Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Wed, 19 Oct 2016 16:07:02 -0500 Subject: [PATCH] Embedded LC BPTC Progress --- bptc.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bptc.py b/bptc.py index c6e7d92..a6c86a5 100755 --- a/bptc.py +++ b/bptc.py @@ -163,9 +163,16 @@ def encode_emblc(_lc, _csum5): for hindex,hbit in zip(xrange(index+11,index+16), hamming.enc_16114(_binlc[index:index+11])): _binlc.insert(hindex,hbit) - # TO DO NEXT: - # ADD PARITY BIT CALUCATIONS AND INTERLEAVE, RETURN A TUPLE OR LIBRARY OR EACH SEGMENT OF THE LC + print(_binlc, len(_binlc)) + for index in xrange(0,16): + _binlc.insert(index+112, _binlc[index+0] ^ _binlc[index+16] ^ _binlc[index+32] ^ _binlc[index+48] ^ _binlc[index+64] ^ _binlc[index+80] ^ _binlc[index+96]) + + print(_binlc, len(_binlc)) + + # TO DO NEXT: + # INTERLEAVE, RETURN A TUPLE OR LIBRARY OR EACH SEGMENT OF THE LC + # EACH SEGMENT IS 4 COLUMNS, TOP TO BOTTOM, LEFT TO RIGHT (PAGE 124 ETSI) #------------------------------------------------------------------------------ # Used to execute the module directly to run built-in tests