Code Block Concatenation
Code Block Concatenation: Transmitter
Each codeblock is individually channel coded and broken further into 1 or 2 codeblock segments. All these codeblock segments are concatenated by the last module of the upper physical layer chain. The implementation is compliant with section 5.5 of [3GPPTS38212]. An example to demonstrate the implementation is shown below:
Example:
numBatches = 5    # Number of user equipments
numCBs     = 2    # Number of code blocks
#bit generation
bits = np.random.randint(2, size = (numBatches, numCBs, 200))
numTargetBits  = 4224  # Number of target bits
cbConcatenated = CodeBlockConcatenation(numTargetBits)(bits) # Returns the concatenated code blocks
The details of the API of codeblock concatenation is detailed below.
Code Block Segregation: Receiver
The block performs the opposite of code-block concatenation. It breaks the received codeword into multiple codeblock-segments for rate matching.
Example:
numInfoBits   = 1555  # Payload size (Number of Information bits)
numOfSegments = 2     # Number of codeblocks
E             = 2112  # Rate matching output sequence length
#bit generation
bits = np.random.randint(2, size = (numBatches, 4224))
codewordSegregation = CodeBlockSegregation(numInfoBits)(bits, E, numOfSegments) # Returns the code blocks
The details of the input output interface of codeblock segregation is shown below:
- class toolkit5G.ChannelCoder.PolarCoder.CodeBlockSegregation[source]
- Parameters:
- None 
- Input:
- inputBits ([\(\dots, \text{N}_\text{cb}, \text{K}\)], np.float32) – code-blocks, where \(\text{N}_\text{cb}\) defines the number of code blocks and \(\text{K}\) defines the length of LDPC encoded code-block. 
- Output:
- [ \(\dots, \text{N}_\text{cb} \times \text{K'}\)] – returns the transport block having a size \(\text{N}_\text{cb} \times \text{K'}\) where \(\text{K'}\): includes code block CRC and few 0s. The detailed relation between \(\text{K'}\) and \(\text{K}\) is defined in section 5.2.2 of [3GPPTS38212_LDPC]. 
- Raises:
- ValueError – “[Error-CodeBlockAggregation]: ‘inputBits’ must be an Numpy array of numbers!” 
- ValueError – “[Error-CodeBlockSegmentation]: ‘codeRate’ should either be an float!” 
- ValueError – “[Error-CodeBlockSegmentation]: ‘codeRate’ should be in (0,1]!” 
- ValueError – “[Error-CodeBlockAggregation]: ‘tbSize’ should either be an int!” 
- ValueError – “[Error-CodeBlockAggregation]: ‘tbSize’ should be non-zero +ve number!”