Cyclic Redundancy Check

The cyclic redundancy check is used for error detection in the payload bits. At the transmitter side, the CRCEncoder is add the parity bits at the end of payload information. These parity bits are used by CRCDecoder at the receiver to detect errors in the received payload bits. These parity bits are computed using a generator polynomial whose order is equal to the number of parity bits. The 3GPP has standardized 6 generator polynomials for parity bits generation of certain length which are used by the different physical chains. The details about these polynomials are given below.

Table 25 Table-2: Uplink Reference Signal and its utility

crcType

Length

Generator Polynomial

Usage

“CRC24A”

24

\(g_{CRC24A}(D) = D^{24} + D^{23} + D^{18} + D^{17} + D^{14} + D^{11} + D^{10} + D^{7} + D^{6} + D^{5} + D^{4} + D^{3} + D + 1\)

PDSCH, PUSCH-TB

“CRC24B”

24

\(g_{CRC24A}(D) = D^{24} + D^{23} + D^{6} + D^{5} + D + 1\)

PDSCH, PUSCH(shared)-CB

“CRC24C”

24

\(g_{CRC24A}(D) = D^{24} + D^{23} + D^{21} + D^{20} + D^{17} + D^{15} + D^{13} + D^{12} + D^{8} + D^{4} + D^{2} + D + 1\)

PDCCH, PBCH

“CRC16”

16

\(g_{CRC24A}(D) = D^{16} + D^{12} + D^{5} + 1\)

PDSCH, PUSCH-TB

“CRC11”

11

\(g_{CRC24A}(D) = D^{11} + D^{10} + D^{9} + D^{5} + 1\)

PUCCH, PUSCH(control)-CB

“CRC6”

6

\(g_{CRC24A}(D) = D^{6} + D^{5} + 1\)

PUCCH, PUSCH(control)-CB

The details about the implementation, usage and application interface is provided in following sections.

Table of Contents

CRC Encoder

CRC Encoder attaches the parity bits to inputs sequence based on the crc polynomial configured. It supports all the CRC polynomials standardized by 3GPP for 5G. It supports the CRC polynomial “CRC24A”, “CRC24B”, “CRC24C”, “CRC16”, “CRC11”, and “CRC6”. The details of these polynomial are provided in Section 5.1 of [3GPPTS38211_crc]. CRC Encoder uses Sionna CRC Encoder internally. The has been design to pass input exactly same as Sionna CRC Encoder for compatibility.

Important

  • CRC Encoder doesn’t support 1D arrays as inputs. The arrays of dimension (N,) can be passed by reshaping it to (1,N).

The CRC encoding is performed as follows:

CRC Encoding for 1D NumPy Arrays

bits       = np.random.randint(0, 2, size = (1,32)) # Bits to be Encoded
crcType    = "CRC24C"
crcEncoder = CRCEncoder(crcType) # Create object of CRC Encoder
crcBits    = crcEncoder(bits)    # Encode the bits (attach the CRC at the end)
## Shape of crcBits will be (1, 56)

CRC Encoding for 2D NumPy Arrays

bits       = np.random.randint(0, 2, size = (21,64)) # Bits to be Encoded
crcType    = "CRC16"
crcBits    = CRCEncoder(crcType)(bits)    # Encode the bits (attach the CRC at the end)
## Shape of crcBits will be (21, 80)

CRC Encoding for Higher dimension NumPy Arrays

bits       = np.random.randint(0, 2, size = (8,6,119)) # Bits to be Encoded
crcType    = "CRC6"
crcBits    = CRCEncoder(crcType)(bits)    # Encode the bits (attach the CRC at the end)
## Shape of crcBits will be (8,6,125)

The details about the input-output interface of the Symbol demapper detailed below.

class toolkit5G.CRC.CRCEncoder(crcType, dtype=None, *arg)[source]

The module inserts the cyclic redundancy bits to the bits passed to the call method. The parity bits are generated using the cyclic generator polynomials passed to the constructor (init) method. This class uses CRCEncoder from sionna.fec.crc.CRCEncoder .

Parameters:
  • crcType (str) – It defines the CRC type \(\in \{\text{"CRC24A"}, \text{"CRC24B"},\) \(\text{"CRC24C"}, \text{"CRC16"}, \text{"CRC11"}, \text{"CRC6"}\}\).

  • *args (arguments) – As per sionna.fec.crc.CRCEncoder .

Input:

[…, length], np.int8 – Input sequence

Output:

[…, length+crcLength], np.int8 – CRC encoded sequence.

Note

crcLength is 24, 24, 24,16, 11, 6 for crcType \(= \{\text{"CRC24A"}, \text{"CRC24B"}, \text{"CRC24C"},\) \(\text{"CRC16"}, \text{"CRC11"}, \text{"CRC6"}\}\) respectively.

Raises:

ValueError – [Error-CRCEncoder]: ‘inBits’ must be an NumPy array of number!

References:
[3GPPTS38211_crc]

3GPP TS 38.211 “Physical channels and modulation (Release 17)”, V17.1.0 (2022-03).