Layer Mapper

The layer mapper divides the symbols across

Layer Mapper: Transmitter

Example

coderate = 0.650390625 #Code Rate
#crcTBlock ---> Transport Block with CRC bits attached

cbSegment   = CodeBlockSegmentation(coderate) # Object for processing the code blocks
codeblocks  = cbSegment(crcTBlock) # Attach the segment the TB and attach the CRC to TB based on 38.212
class toolkit5G.PhysicalChannels.PDSCH.LayerMapper(numCodewords, numLayers)[source]

Defines the layer mapper for physical downlink shared channel and physical uplink shared channel. The implementation details are provided in section 7.3.1.3 of [3GPPTS38211pdsch].

Parameters:
  • numCodewords (int) – Number of codewords to be layer mapped \(\in \{1,2\}\)

  • numLayers (int) – Number of layer to which these codewords will be mapped \(\in \{1,2,3,4,5,6,7,8\}\)

Important

The numLayers should be less \(\leq 4\) if numCodewords is 1 otherwise it should be \(4 \leq\) numLayers \(\leq 8\).

Tip

For numCodewords \(= 2\), the distribution of layers across the codewords is shown in table-1 demonstrated above.

Input:
  • codeword1 ([…, \(\text{E}_1\)], np.complex64) – Codeword-1 to be mapped to the layers.

  • codeword2 ([…, \(\text{E}_2\)], np.complex64 or None) – Codeword-2 to be mapped to the layers. It should be passed only when the numCodewords is 2. Default value is None.

Note

For numCodewords \(= 1\), \(\text{E}_1\) should be multiple of numLayers. For numCodewords \(= 2\), \(\text{E}_1\) and \(\text{E}_2\) should be multiple of \(\text{N}_\text{L}^1\) and \(\text{N}_\text{L}^2\) repectively where \(\text{N}_\text{L}^1 + \text{N}_\text{L}^2 =\) numLayers.

Output:

[…, numLayers, \(\text{E}\)], np.complex64 – Layer mapped symbols.

Note

For numCodewords \(= 1\), \(\text{E} = \frac{\text{E}_1}{\text{N}_\text{L}}\) where \(\text{N}_\text{L}\) is numLayers. For numCodewords \(= 2\), \(\text{E} = \frac{\text{E}_2}{\text{N}_\text{L}^2} = \frac{\text{E}_1}{\text{N}_\text{L}^1}\) where \(\text{N}_\text{L}^1 + \text{N}_\text{L}^2 =\) numLayers.

Raises:
  • ValueError – [Error-LayerMapper]: numSymbols in ‘codeword1’ is not matching (numSymbolPerLayer x numLayers)!

  • ValueError – [Error-LayerMapper]: numSymbols in ‘codeword1’ is not matching (numSymbolPerLayer x numLayers)!

  • ValueError – [Error-LayerMapper]: ‘codeword1’ should be 2-dimension array (numBatch x numSymbols)!

  • ValueError – [Error-LayerMapper]: ‘codeword2’ should be passed for 2 codewords!

  • ValueError – [Error-LayerMapper]: numSymbols in ‘codeword2’ is not matching (numSymbolPerLayer x numLayers)!

  • ValueError – [Error-LayerMapper]: numSymbols in ‘codeword2’ is not matching (numSymbolPerLayer x numLayers)!

  • ValueError – [Error-LayerMapper]: ‘codeword2’ should be 2-dimension array (numBatch x numSymbols)!

  • ValueError – [Error-LayerMapper]: Inconsistent dimensions and size for both two codewords!

  • ValueError – [Error-LayerMapper]: number of symbols per layer must be same for both the codewords!

  • ValueError – [Error-LayerMapper]: ‘numCodewords’ should either be an integer!

  • ValueError – [Error-LayerMapper]: ‘numCodewords’ should be either 1 or 2!

  • ValueError – [Error-LayerMapper]: ‘numLayers’ should either be an integer!

  • ValueError – [Error-LayerMapper]: For “+str(self.__numCodewords)+” ‘Codewords’, ‘numLayers’ should either be from interval [1, “+str(numLayerperCW[self.__numCodewords])+”]!

Layer Demapper: Receiver

Example

# rmBits ---> Rate Matched Output Block after Interleaving

codeword   = CodeBlockConcatenation()(rmBits) #Performs Code Block Concatenation
class toolkit5G.PhysicalChannels.PDSCH.LayerDemapper(numCodewords, numLayers)[source]

Defines the layer demapper for physical downlink shared channel and physical uplink shared channel. It performs opposite operation to layer mapping. The implementation details are provided in section 7.3.1.3 of [3GPPTS38211pdsch].

Parameters:
  • numCodewords (int) – Number of codewords to be layer mapped \(\in \{1,2\}\)

  • numLayers (int) – Number of layer to which these codewords will be mapped \(\in \{1,2,3,4,5,6,7,8\}\)

Important

The numLayers should be less \(\leq 4\) if numCodewords is 1 otherwise it should be \(4 \leq\) numLayers \(\leq 8\).

Tip

For numCodewords \(= 2\), the distribution of layers across the codewords is shown in table-1 demonstrated above.

Input:

payload ([…, numLayers, \(\text{E}\)], np.complex64) – Layer mapped symbo

Output:
  • […, \(\text{E}_1\)], np.complex64 – Layer demapped symbol Codeword-1.

  • […, \(\text{E}_2\)], np.complex64 or None – Layer demapped symbol Codeword-2. It should be passed only when the numCodewords is 2. Default value is None.

Note

For numCodewords \(= 1\), \(\text{E}_1 = \text{N}_\text{L} \times \text{E}\) where \(\text{N}_\text{L} =\) numLayers. For numCodewords \(= 2\), \(\text{E}_1 = \text{N}_\text{L}^1 \times \text{E}\) and \(\text{E}_2 = \text{N}_\text{L}^2 \times \text{E}\) where \(\text{N}_\text{L}^1 + \text{N}_\text{L}^2 =\) numLayers.

Raises:
  • ValueError – [Error-LayerDemapper]: payload has “+str(numLayers)+” layers, codeword-1 and codeword-2 are expected to consists of “+str(self.__numLayers1)+” and “+str(self.__numLayers2)+” respectively

  • ValueError – [Error-LayerDemapper]: ‘Input Array’ should be a 3 dimension array (numBatches x numLayers x numSymbolsPerLayers)!

  • ValueError – [Error-LayerDemapper]: ‘numCodewords’ should either be an integer!

  • ValueError – [Error-LayerDemapper]: ‘numCodewords’ should be either 1 or 2!

  • ValueError – [Error-LayerDemapper]: ‘numLayers’ should either be an integer!

  • ValueError – [Error-LayerDemapper]: For “+str(self.__numCodewords)+” ‘Codewords’, ‘numLayers’ should either be from interval [1, “+str(numLayerperCW[self.__numCodewords])+”]!