Main Content

nrTBS

Transport block size

Since R2020b

    Description

    General TBS Calculation

    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) in a single PRB across the allocated symbols (excluding DM-RS symbols). 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(mod,nlayers,nPRB,NREPerPRB,tcr,xOh) also specifies the additional overhead. The additional overhead accounts for the presence of other signals, such as, channel state information reference signal (CSI-RS) and control resource set (CORESET). The scaling factor used for TBS calculation is 1.

    example

    tbs = nrTBS(mod,nlayers,nPRB,NREPerPRB,tcr,xOh,tbScaling) also specifies the scaling factor. 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

    PDSCH

    Since R2025a

    tbs = nrTBS(pdsch,tcr) returns the TBS for the physical downlink shared channel (PDSCH) configuration, pdsch, and target code rate, tcr.

    tbs = nrTBS(pdsch,tcr,xOh) also specifies the additional overhead.

    tbs = nrTBS(pdsch,tcr,xOh,tbScaling) also specifies the TBS calculation scaling for the PDSCH system transmissions, tbScaling.

    PDSCH for Waveform Generation

    Since R2025a

    tbs = nrTBS(pdschwg) returns the TBS for the waveform generation-specific PDSCH configuration, pdschwg.

    PUSCH

    Since R2025a

    tbs = nrTBS(pusch,tcr) returns the TBS for the physical uplink shared channel (PUSCH) configuration, pusch, and target code rate, tcr.

    tbs = nrTBS(pusch,tcr,xOh) also specifies the additional overhead.

    tbs = nrTBS(pusch,tcr,xOh,carrier) also specifies the carrier configuration, carrier. Use this syntax for interlaced PUSCH transmissions, that is, when pusch.Interlacing is set to true.

    PUSCH for Waveform Generation

    Since R2025a

    tbs = nrTBS(puschwg) returns the TBS for the waveform generation-specific PUSCH configuration, puschwg.

    tbs = nrTBS(puschwg,carrierUL) also specifies the uplink carrier configuration, carrierUL. Use this syntax for interlaced PUSCH transmissions, that is, when puschwg.Interlacing is set to true.

    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. When the number of layers is less than or equal to four, single codeword transmission is used. When the number of layers is greater than four, two-codeword transmission is used.

    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 in a single PRB across the allocated symbols (excluding DM-RS symbols), specified as an integer scalar. 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 accounts for the presence of other signals, such as, CSI-RS and 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

    Since R2025a

    PDSCH configuration, specified as an nrPDSCHConfig object.

    Since R2025a

    PDSCH configuration for waveform generation, specified as an nrWavegenPDSCHConfig object.

    Since R2025a

    PUSCH configuration, specified as an nrPUSCHConfig object.

    Since R2025a

    PUSCH configuration for waveform generation, specified as an nrWavegenPUSCHConfig object.

    Since R2025a

    Carrier configuration, specified as an nrCarrierConfig object.

    Since R2025a

    Uplink carrier configuration, specified as an nrULCarrierConfig object.

    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 or equal to 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

    expand all

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

    Version History

    Introduced in R2020b

    expand all

    See Also

    Objects