PDSCH: Upper Physical layer Chain

This module implements the upper physical layer of physical downlink shared channel (PDSCH). It consists of transport block processing, code-block segmentation, LDPC encoder, rate matching and code-block concatenation as shown below.

Alternative text

An Example of how to initialize and call the PDSCH upper PHY to generate codewords

numSymbols         = 13
numRB              = 25
mcsIndex           = 2
numlayers          = [1]
scalingField       = '00'
additionalOverhead = 0
dmrsREs            = 3
numTBs             = 1
mcsTable           = 'pdschTable1'



pdschUpperPhy = PDSCHUpperPhy(symbolsPerSlot = numSymbols, numRB = numRB, mcsIndex = mcsIndex,
                          numlayers = numlayers, scalingField = scalingField, additionalOverhead = additionalOverhead,
                          dmrsREs = dmrsREs, numTBs=numTBs, pdschTable = mcsTable, verbose = True)

codeword      = pdschUpperPhy(tblock = [None, None], rvid = [0, 0], enableLBRM = [False, False], numBatch = 1, numBSs = 1)

The details of the input-output interface are provided in following sub-section.

class toolkit5G.PhysicalChannels.PDSCHUpperPhy(symbolsPerSlot, numRB, mcsIndex, numlayers, scalingField, additionalOverhead, dmrsREs=3, numTBs=1, pdschTable='pdschTable1', verbose=False)[source]

This class performs Transmitter side of Upper Physical Layer Processing of Physical Downlink Shared Channel.

Parameters:
  • symbolsPerSlot (int) – Number of symbols allocated per Slot. It takes a scalar or numpy integer. It can take values between 1 and 14.

  • numRB (int) – Number of Physical Resource Blocks allocated. Each RB consists of 12 sub-carriers. It takes a integer value >0.

  • mcsIndex (int or np.ndarray) – Refers to the Modulation and Coding Scheme (MCS) Index. It takes either be an integer or a numpy array containing 2 values based on the argument passed to pdschTable

    -If pdschTable is None, mcsIndex expects a numpy array containing 2 values [modulation order, code Rate].

    -If pdschTable is passed a string value, then mcsIndex takes an integer value (mcsIndex or cqiIndex in 5G standards) from the interval [LowerBound, Upperbound]. The interval is different for different pdschTable values. The LowerBound and Upperbound of the interval are defined in following table.

    Table

    pdschTable

    LowerBound

    Upperbound

    PDSCH Table 1

    ‘pdschTable1’

    0

    28

    PDSCH Table 2

    ‘pdschTable2’

    0

    27

    PDSCH Table 3

    ‘pdschTable3’

    0

    28

    PDSCH Table 4

    ‘pdschTable4’

    0

    26

    PUSCH Table 1

    ‘puschTable1’

    0

    27

    PUSCH Table 2

    ‘puschTable2’

    0

    27

    CQI Table 1

    ‘cqiTable1’

    1

    15

    CQI Table 2

    ‘cqiTable2’

    1

    15

    CQI Table 3

    ‘cqiTable3’

    1

    15

    CQI Table 4

    ‘cqiTable4’

    1

    15

  • numlayers ((1 or 2, ), list) – Number of MIMO layers (the number of layers is equal to the number of allocated DMRS Ports) for each transport block.

    • If numTBs is 1 then the list contains only one value

    • If numTBs is 2 then it contains 2 values.

    The elements of the list should take values between 1 and 4. Note: 5G can support a maximum of 8 layers. The details of configuring this parameter are provided below:

    Num of Layers

    Layers in TB-0

    Layers in TB-1

    numlayers

    1

    1

    x

    [1] or [1,0]

    2

    2

    x

    [2] or [2,0]

    3

    3

    x

    [3] or [3,0]

    4

    4

    x

    [4] or [4,0]

    5

    2

    3

    [2,3]

    6

    3

    3

    [3,3]

    7

    3

    4

    [3,4]

    8

    4

    4

    [4,4]

  • scalingField (str) – Transport Block Scaling Field. For more details please refer to table 5.1.3.2-2 of 3GPP TS 38.214. It accepts a string. Valid Strings are ‘00’, ‘01’, ‘10’.

  • additionalOverhead (int) – Additional Overheads. It includes the resource elements (occupied by PTRS, other RS and remaining physical Channels) which are not available for the PDSCH transmission. For more details, please refer to 3GPP TS 38.214. It doesn’t include PDSCH-DMRS. It takes integer value from the set {0, 6, 12, 18}.

  • dmrsREs (int) – Resource Elements per resource Block allocated to Demodulation Reference Signals. The default value is 3.

  • numTBs (int) – Number of transport blocks passed to Physical layer from MAC. The Physical layer can process either 1 or 2 Transport Blocks for each resource allocation.

  • pdschTable (str) – The Lookup table to be used for the selection of Modulation Order and code Rate It can take a string value from the set {‘pdschTable1’, ‘pdschTable2’, ‘pdschTable3’, ‘pdschTable4’, ‘puschTable1’, ‘puschTable2’,’cqiTable1’, ‘cqiTable2’, ‘cqiTable3’, ‘cqiTable4’}.

  • verbose (bool) – By enabling verbose, it displays information about the progress in the execution of the modules. Such as size of the input/output vectors input to the modules and parameters being passed. By default, set to ‘False’.

Input:
  • tblock ((numTBs,), list of np.ndarray) – Defines the Transport Blocks (TBs). TBs are the Data packets transferred between MAC and Phy Layer. The size of each TB in the list is: (…, tbSize-i). Notes: If tblock is not passed, the code generates the tblock(s) of size(s) = (numBatches, numBSs, tbSize-i).

  • rvid ((numTBs,), list of integer(s)) – Defines Redundancy Version ID(s) for each TB. RVID(s) is(are) used by the Rate Matching block for incremental redundancy based HARQ implementation supported by 5G standards. The list contains:

    • One value, [rvid1] if numTBs=1,

    • Two values, [rvid1, rvid2] if numTBs=2.

  • enableLBRM ((numTBs,), list of bool) – Enable / Disable Limited Buffer Rate Matching. The concept of LBRM is to help reduce the requirement for buffering large code blocks, thus minimizing the memory required. The list contains:

    • One value, [enableLBRM1] if numTBs=1,

    • Two values, [enableLBRM1, enableLBRM2] if numTBs=2.

  • numBatches (int) – Number of Batches

  • numBSs (int) – Number of Base stations

Output:
  • codeword ([numTBs,], list of np.ndarray) – List containing either one or two numpy arrays containing the codewords each of size (…, numTargetBits1) and (…, numTargetBits2) respectively. The length of the list depends on the number of TBs numTBs i.e. one codeword when the numTBs is 1 and two codewords when the numTBs is 2.

    • It returns the Transport Block Size. The return type is scalar or numpy integer

  • .. important:: – The parameters with names ending with 2 (tbLen2, tblock2, numTargetBits2, etc.) exist only when numTBs is 2.

Attributes:
  • tbLen1 (int) – Size of Transport Block-1.

  • tbLen2 (int) – Size of Transport Block-2. tbLen2 exists only when number of TBs (numTBs) is 2.

  • numTargetBits1 (int) – Size of the codeword-1 (output of rate-matching for TB-1).

  • numTargetBits2 (int) – Size of the codeword-2 (output of rate-matching for TB-2). tbLen2 exists only when number of TBs (numTBs) is 2.

  • tblock1 ((…, tbLen1), np.ndarray) – Defines the transport block-1.

  • tblock2 ((…, tbLen2), np.ndarray) – Defines the transport block-2. tbLen2 exists only when number of TBs (numTBs) is 2.

  • bg (str) – The base graph chosen for LDPC encoding.

  • zc (str) –

    The lifting factor chosen for LDPC encoding.

    • The length of the list can be one or two based on the number of code blocks belonging to either of the list distinguished by the condition specified in 3GPP TS 38.212 version 16 Section 5.4.2.1.

  • .. Note::tblock1 and tblock2 variables are useful for BER computation when user doesn’t pass them as input. In such as case, code randomly generates the tensors of shape (numBatches, numBSs, tbLen1) and (numBatches, numBSs, tbLen2).


Tip

The PDSCH UpperPhy configurations is recommended to generate standard compliant parameters that does not conflict with one another