Main Content

nrTBS

Get transport block size

Since R2020b

    Description

    tbs = nrTBS(mod,nlayers,nPRB,NREPerPRB,tcr) returns tbs, the transport block size (TBS), associated with each codeword for a shared channel transmission, as defined in TS 38.214 Sections 5.1.3.2 and 6.1.4.2. modulation is the modulation scheme for each codeword and nlayers is the number of transmission layers. nPRB is the number of physical resource blocks (PRBs) allocated for the physical shared channel. NREPerPRB is the number of resource elements (REs) allocated for the data transmission in the shared channel within one PRB for one slot (without accounting for the additional overhead). tcr is the target code rate for each codeword. The additional overhead and scaling factor used for TBS calculation are 0 and 1, respectively.

    tbs = nrTBS(___,xOh) specifies the additional overhead in addition to the input arguments of the previous syntax. The additional overhead accounts for the overhead from channel state information reference signal (CSI-RS) and control resource set (CORESET). xOh controls the number of REs available for the data transmission in the shared channel within one PRB for one slot. The scaling factor used for TBS calculation is 1.

    example

    tbs = nrTBS(___,tbScaling) specifies the scaling factor in addition to the input arguments of the previous syntax. The function uses tbScaling to calculate the intermediate number of information bits, N_info, as defined in TS 38.214 Section 5.1.3.2.

    example

    Examples

    collapse all

    Specify the modulation scheme for one codeword as 16-QAM, the number of transmission layers as 4, and the number of PRBs allocated for the shared channel as 52. Specify the number of REs allocated for the shared channel within one PRB for one slot (without accounting for the additional overhead) as 120. Set the target code rate to 0.48.

    modulation = '16QAM';
    nlayers = 4;
    nPRB = 52;
    NREPerPRB = 120;
    tcr = 0.48;

    Get the TBS associated with a data transmission having the additional overhead of 6 and scaling factor of 0.25.

    xOh = 6;
    tbScaling = 0.25;
    tbs = nrTBS(modulation,nlayers,nPRB,NREPerPRB,tcr,xOh,tbScaling)
    tbs = 
    11272
    

    Specify the modulation schemes for two codewords as QPSK and 64-QAM. Set the number of transmission layers to 8, and the number of PRBs allocated for the shared channel as 106. Specify the number of REs allocated for the shared channel within one PRB for one slot (without accounting for the additional overhead) as 100.

    modulation = ["QPSK","64QAM"];
    nlayers = 8;
    nPRB = 106;
    NREPerPRB = 100;

    Specify the target code rates for two codewords as 0.3701 and 0.4277. Get the payload size of each transport block for a shared channel transmission.

    tcr = [0.3701 0.4277];
    tbs = nrTBS(modulation,nlayers,nPRB,NREPerPRB,tcr)
    tbs = 1×2
    
           31240      108552
    
    

    Input Arguments

    collapse all

    Modulation scheme, specified as 'pi/2-BPSK', 'QPSK', '16QAM', '64QAM', '256QAM', '1024QAM', a string scalar, a string array, or a cell array of character vectors. The modulation scheme for a single codeword is specified as a character vector or a string scalar. If two codewords are present, a single modulation scheme can be applied to both codewords. Alternatively, you can specify different modulation schemes for each codeword by using a string array or a cell array of character vectors.

    Modulation SchemeNumber of Bits Per Symbol
    'pi/2-BPSK'1
    'QPSK'2
    '16QAM'4
    '64QAM'6
    '256QAM'8
    '1024QAM'10

    Data Types: char | string | cell

    Number of transmission layers, specified as an integer from 1 to 8. For one codeword, use an integer from 1 to 4. For two codewords, use an integer from 5 to 8.

    Data Types: double

    Number of PRBs allocated for the physical shared channel, specified as a nonnegative integer. The nominal value of this argument is in the range of 0 to 275.

    Data Types: double

    Number of REs allocated for the data transmission in the physical shared channel within one PRB for one slot, specified as a nonnegative integer. This value excludes any additional overhead.

    Data Types: double

    Target code rate for each codeword, specified as a scalar between 0 and 1 or a two-element vector of values between 0 and 1. Configure two codewords with different target code rates by specifying a two-element vector. Configure two codewords with the same target code rate by specifying a scalar.

    Data Types: double

    Additional overhead, specified as a nonnegative integer. The additional overhead controls the number of REs available for the data transmission in the physical shared channel within one PRB for one slot. The additional overhead accounts for the overhead from channel state information reference signal (CSI-RS) and control resource set (CORESET). The nominal value of the additional overhead is 0, 6, 12, or 18, provided by the higher-layer parameter xOverhead in PDSCH-ServingCellConfig IE or PUSCH-ServingCellConfig IE.

    Data Types: double

    Scaling factor, specified as a scalar in the range (0, 1] or a two-element vector of values in the range (0, 1]. The function uses this value in calculating the intermediate number of information bits, N_info, as defined in TS 38.214 Section 5.1.3.2. Configure two codewords with different scaling factors by specifying a two-element vector. Configure two codewords with the same scaling factor by specifying a scalar.

    The nominal value of the scaling factor is 0.25, 0.5, or 1, as defined in TS 38.214 Table 5.1.3.2-2.

    Data Types: double

    Output Arguments

    collapse all

    Transport block size associated with each codeword in the shared channel transmission, returned as a nonnegative integer or a two-element vector of nonnegative integers.

    The value of tbs is 0 in any of these cases.

    • When the NREPerPRB input is 0

    • When the nPRB input is 0

    • When the NREPerPRB input is less than the xOh input

    Data Types: double

    References

    [1] 3GPP TS 38.214. “NR; Physical layer procedures for data.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2020b

    expand all

    See Also

    Objects