ait.dsn.bch.bch package

bch.py provides a BCH (Bose, Chaudhuri, Hocquenghem) code class

Author: Kabir Marwah / ASU

class ait.dsn.bch.bch.BCH

Bases: object

The BCH class is intended to provide methods and attributes to generate BCH code blocks and appends them to TC Transfer Frames, to produce a valid CLTU that can be interpreted by IRIS v2 Radio

static bitArrayToBitStr(bit_array)

Converts a bit-array to bit-string :param bit_array: the bit-array to be converted :return bit_string: the converted bit-array as string

static bitStrToByteArray(bit_str)

Converts a bit-string to byte-array :param byte_array: the bit-string to be converted :return bit_array: the converted bit-array

static byteArrayToBitStr(byte_array)

Converts a byte-array to bit-string :param byte_array: the byte-array to be converted :return bit_string: the converted bit-array as string

static generateBCH(input_byte_array)

Generates the BCH code blocks. Appends the error code handling bits to the TC Transfer Frame to enable construction of CLTUs :param input_byte_array: the TC Transfer Frame byte array that is used to generate the BCH code blocks, expected to be 7-bytes :return byte_array: returns full 8 byte byte-array with BCH code blocks appended to the end, or None if input data is invalid