Code Block Segmentation

Codeblock segmentation allows the physical layer to process large transport blocks to make the best use of the capabilities of the encoder and decoders. To make the best use of the structure of the Polar codes the inputs shall be passed in a certain format with the bound on the upper limit of the inputs that Polar codec can process. In case transport block sizes exceed the upper limit, it is broken into multiple smaller sub-blocks called codeblocks which are individually processed by Polar encoder/decoder and ratemater/dematcher at transmitter and receiver respectively. The implementations are discussed in details in upcoming sub-sections.

Code Block Segmentation: Transmitter

The codeblock segmentation breaks the large transport block into small codeblock which are processed individually a defined in Section 5.2.1 of [3GPPTS38212_Polar]. The example demonstrate a way to use the CodeBlockSegmentation module.

numBatches    = 5    # Number of user equipments
numTargetBits = 4224 # Number of target bits
#bit generation
bits = np.random.randint(2, size = (numBatches, 20))

segmentationObj = CodeBlockSegmentation() # Object for processing the code blocks
codeSegment     = segmentationObj(numTargetBits, bits) # Returns the code blocks with CRC attached based on 38.212

The API for codeblock segmentation is as follows.

class toolkit5G.ChannelCoder.PolarCoder.CodeBlockSegmentation[source]

This module implements a 5G standards complaint Encoder for Polar Codes. The modules is built on the top on Sionna Polar Decoder with modifications to provide low level API for section 5.3.1 of 38.212 specifications [3GPPTS38212Polar]. Moreover, it corrects the broken standards complaince and optimize the implementation for performance and memory.

Parameters:
  • K (int) – Number of information bits to encode.

  • E – Number of target bits after rate matching.

  • purpose (str) – Defines the physical channel for which the Polar Decoder is being used. It is used computation of N (number of coded bits at the out of Polar Decoder) \(\in \{\) “PBCH”, “PDCCH”, “PUCCH” \(\}\).

  • verbose (bool) – Defaults to False. If True, rate-matching parameters will be printed.

Input:
  • modOrder

  • numTargetBits

  • formatPUCCH – Defines th Format of

  • inputBits ([…,K], tf.float32) – 2+D tensor containing the channel logits/llr values.

Output:

[…,N], np.float32 – 2+D tensor containing hard-decided estimates of all k information bits.

Raises:
  • Exception – “[Error]: Invalid value for “”K”” for UCI:PUCCH!”

  • Exception – “[Error]: Invalid value for “”purpose””!”

  • ValueError – “[Polar Encoder]: ‘input’ must a numpy array of numbers!”

Note

Although the decoding list size is not provided by 3GPP [3GPPTS38212Polar], the consortium has agreed on a list size of 8 for the 5G decoding reference curves [Bioglio].

All list-decoders apply CRC-aided decoding, however, the non-list decoders (“SC” and “BP”) cannot materialize the CRC leading to an effective rate-loss.

Code Block Aggregation: Receiver

It performs opposite of code-block segmentation at the receiver to reconstruct the Transmitted Block and forwarding to MAC layer. Example is understand the usage is shown below.

numBatches = 5    # Number of user equipments
numCBs     = 2    # Number of code blocks
#bit generation
bits = np.random.randint(2, size = (numBatches, numCBs, 20))

aggrObj = CodeBlockAggregationPUCCH() # Object performing code block aggregation
aggrOp  = aggrObj(bits) # Returns transmitted block

The details of the API of codeblock aggregation is shown below:

class toolkit5G.ChannelCoder.PolarCoder.CodeBlockAggregation[source]