shuffle the code bits

This commit is contained in:
Ahmet Inan 2023-12-16 08:30:47 +01:00
commit 513664a0e3
2 changed files with 6 additions and 0 deletions

View file

@ -14,6 +14,7 @@ namespace DSP { using std::abs; using std::min; using std::cos; using std::sin;
#include "xorshift.hh"
#include "trigger.hh"
#include "complex.hh"
#include "permute.hh"
#include "decibel.hh"
#include "blockdc.hh"
#include "hilbert.hh"
@ -204,6 +205,7 @@ struct Decoder
CODE::OrderedStatisticsDecoder<255, 71, 4> osddec;
CODE::PolarEncoder<mesg_type> polarenc;
CODE::PolarListDecoder<mesg_type, code_order> polardec;
CODE::ReverseFisherYatesShuffle<code_len> shuffle;
int8_t genmat[255*71];
mesg_type mesg[max_bits], mess[code_len];
code_type code[code_len];
@ -431,6 +433,7 @@ struct Decoder
*len = data_bits / 8;
crc_bits = data_bits + 32;
CODE::PolarHelper<mesg_type>::PATH metric[mesg_type::SIZE];
shuffle(code);
polardec(metric, mesg, code, frozen_bits, code_order);
systematic();
int order[mesg_type::SIZE];

View file

@ -9,6 +9,7 @@ Copyright 2021 Ahmet Inan <inan@aicodix.de>
#include <cmath>
#include "xorshift.hh"
#include "complex.hh"
#include "permute.hh"
#include "utils.hh"
#include "bitman.hh"
#include "decibel.hh"
@ -48,6 +49,7 @@ struct Encoder
CODE::CRC<uint32_t> crc1;
CODE::BoseChaudhuriHocquenghemEncoder<255, 71> bchenc;
CODE::PolarSysEnc<code_type> polarenc;
CODE::FisherYatesShuffle<code_len> shuffle;
code_type code[code_len], mesg[max_bits];
cmplx fdom[symbol_len];
cmplx tdom[symbol_len];
@ -241,6 +243,7 @@ struct Encoder
for (int i = 0; i < 32; ++i)
mesg[i+data_bits] = nrz((crc1()>>i)&1);
polarenc(code, mesg, frozen_bits, code_order);
shuffle(code);
for (int i = 0; i < cons_cols; ++i)
prev[i] = fdom[bin(i+code_off)];
for (int j = 0; j < cons_rows; ++j) {