Main Content

nrULSCHMultiplex

Perform UL-SCH data and control multiplexing

Since R2020b

    Description

    example

    [cw,info] = nrULSCHMultiplex(pusch,tcr,tbs,culsch,cack,ccsi1,ccsi2) returns codeword cw by performing uplink shared channel (UL-SCH) multiplexing on the encoded UL-SCH data and the encoded uplink control information (UCI), as defined in TS 38.212 Section 6.2.7 [1]. pusch is the physical uplink shared channel configuration (PUSCH). tcr is the target code rate. tbs is the transport block size for the UL-SCH transmission. culsch is the encoded UL-SCH data. cack, ccsi1, and ccsi2 are the encoded UCI types.

    The function internally calculates the number of reserved bits for the hybrid automatic repeat request acknowledgment (HARQ-ACK) transmission, GACKRvd and then compares against the lengths of the coded inputs. This comparison determines the processing of the HARQ-ACK for rate-matching or puncturing.

    The length of cw equals the bit capacity of the PUSCH. cw contains the encoded information up to the bit capacity of PUSCH and ignores any other additional information in the inputs. The output cw contains zeros when not enough encoded UL-SCH and encoded UCI (HARQ-ACK, channel state information (CSI) 1, or CSI part 2) data is present to achieve the bit capacity. The function also returns the structure info, which contains information about the 1-based locations of each type in the codeword.

    Examples

    collapse all

    Create a default PUSCH configuration object. Allocate the first 21 resource blocks of the bandwidth part to the PUSCH.

    pusch = nrPUSCHConfig;
    pusch.PRBSet = 0:20;

    Set the target code rate, payload lengths of the UL-SCH data, HARQ-ACK, CSI part 1, and CSI part 2.

    tcr = 0.5;  % Target code rate
    tbs = 100;  % Payload length of UL-SCH data (transport block size)
    oack = 3;   % Payload length of HARQ-ACK
    ocsi1 = 10; % Payload length of CSI part 1
    ocsi2 = 10; % Payload length of CSI part 2

    Get the rate matched lengths of the UL-SCH data, HARQ-ACK, CSI part 1, and CSI part 2.

    rmInfo = nrULSCHInfo(pusch,tcr,tbs,oack,ocsi1,ocsi2);

    Create the predefined coded bits of the UL-SCH, HARQ-ACK, CSI part 1, and CSI part 2 for the rate-matched output length obtained from the rmInfo structure.

    culsch = ones(rmInfo.GULSCH,1);
    cack = 2*ones(rmInfo.GACK,1);
    ccsi1 = 3*ones(rmInfo.GCSI1,1);
    ccsi2 = 4*ones(rmInfo.GCSI2,1);

    Get the codeword from the predefined coded UL-SCH data and coded UCI types.

    cw = nrULSCHMultiplex(pusch,tcr,tbs,culsch,cack,ccsi1,ccsi2);

    To see the multiplexing operation, plot the codeword. The codeword starts with the elements of CSI part 1, followed by HARQ-ACK, CSI part 1, CSI part 2, and the mix of UL-SCH data and CSI part 2.

    plot(cw)
    xlabel('Codeword Indices')
    ylabel('Codeword Values')
    title('Multiplexing Operation')

    Figure contains an axes object. The axes object with title Multiplexing Operation, xlabel Codeword Indices, ylabel Codeword Values contains an object of type line.

    Create a PUSCH configuration object with a pi/2-BPSK modulation scheme and no frequency hopping. Set the beta offset factor for HARQ-ACK to 20, and the beta offset factor for CSI part 1 and CSI part 2 to 6.25 each. Specify the scaling factor as 0.8, which limits the number of resource elements (REs) assigned for the UCI.

    pusch = nrPUSCHConfig;
    pusch.Modulation = 'pi/2-BPSK';
    pusch.FrequencyHopping = 'neither';
    pusch.BetaOffsetACK = 20;
    pusch.BetaOffsetCSI1 = 6.25;
    pusch.BetaOffsetCSI2 = 6.25;
    pusch.UCIScaling = 0.8;

    Set the target code rate, payload lengths of the UL-SCH data, HARQ-ACK, CSI part 1, and CSI part 2.

    tcr = 0.5;   % Target code rate
    tbs = 1032;  % Payload length of UL-SCH data (transport block size)
    oack = 8;    % Payload length of HARQ-ACK
    ocsi1 = 88;  % Payload length of CSI part 1
    ocsi2 = 720; % Payload length of CSI part 2

    Get the rate matched lengths of the data, HARQ-ACK, CSI part 1, and CSI part 2.

    rmInfo = nrULSCHInfo(pusch,tcr,tbs,oack,ocsi1,ocsi2);

    Create the random payload bits for the UL-SCH data, HARQ-ACK, CSI part 1, and CSI part 2.

    data = randi([0 1],tbs,1);
    ack  = randi([0 1],oack,1);
    csi1 = randi([0 1],ocsi1,1);
    csi2 = randi([0 1],ocsi2,1);

    Create a UL-SCH encoder System object.

    encUL = nrULSCH;

    Load the transport block into the UL-SCH encoder.

    setTransportBlock(encUL,data);

    Get the coded bits of length rmInfo.GULSCH by calling the encoder.

    rv = 0; % Redundancy version is 0
    culsch = encUL(pusch.Modulation,pusch.NumLayers,rmInfo.GULSCH,rv);

    Encode the random payload of the HARQ-ACK, CSI part 1, and CSI part 2 for the rate-matched output lengths obtained from the rmInfo structure.

    cack  = nrUCIEncode(ack,rmInfo.GACK,pusch.Modulation);
    ccsi1 = nrUCIEncode(csi1,rmInfo.GCSI1,pusch.Modulation);
    ccsi2 = nrUCIEncode(csi2,rmInfo.GCSI2,pusch.Modulation);

    Get the codeword from the coded bits of the UL-SCH and the coded bits of UCI types.

    [cw,info] = nrULSCHMultiplex(pusch,tcr,tbs,culsch,cack,ccsi1,ccsi2)
    cw = 8112x1 int8 column vector
    
       1
       0
       1
       0
       0
       0
       1
       1
       1
       0
          ⋮
    
    
    info = struct with fields:
        ULSCHIndices: [1622x1 uint32]
          ACKIndices: [1159x1 uint32]
         CSI1Indices: [4482x1 uint32]
         CSI2Indices: [849x1 uint32]
         UCIXIndices: [0x1 uint32]
         UCIYIndices: [0x1 uint32]
    
    

    Input Arguments

    collapse all

    PUSCH configuration parameters, specified as an nrPUSCHConfig object. This function uses only these nrPUSCHConfig object properties.

    Target code rate for the codeword in the UL-SCH transmission, specified as a scalar in the range (0, 1).

    Data Types: double

    Transport block size associated with the codeword in the UL-SCH transmission, specified as a nonnegative integer. A value of 0 indicates no transport block or no UL-SCH transmission on the PUSCH.

    Data Types: double

    Coded UL-SCH data bits, specified as a binary-valued column vector of length gulsch. The gulsch is the number of coded and rate matched UL-SCH data bits returned in the info output argument of the nrULSCHInfo function. The encoded UL-SCH bits, culsch, is the encoded and rate-matched bits obtained by processing the transport block. A value of [] indicates the absence of UL-SCH data transmission. If you specify the tbs input argument as 0, the culsch input argument must be empty.

    The gulsch must be equal to the bit capacity of the data.

    Data Types: int8 | double

    Coded HARQ-ACK bits, specified as a real-valued column vector of length gack. The gack is the number of coded and rate matched HARQ-ACK bits returned in the info output argument of the nrULSCHInfo function. A value of [] indicates the absence of HARQ-ACK transmission. The nominal values of the HAQR-ACK bits are 0, 1, -1, and -2.

    The gack must be a multiple of the product of the number of transmission layers and the modulation order.

    Data Types: int8 | double

    Coded CSI part 1 bits, specified as a real-valued column vector of length gcsi1. The gcsi1 is the number of coded and rate matched CSI part 1 bits returned in the info output argument of the nrULSCHInfo function. A value of [] indicates the absence of the CSI part 1 transmission. The nominal values of the CSI part 1 bits are 0, 1, -1, and -2.

    The gcsi1 must be a multiple of the product of the number of transmission layers and the modulation order.

    Data Types: int8 | double

    Coded CSI part 2 bits, specified as a real-valued column vector of length gcsi2. The gcsi2 is the number of coded and rate matched CSI part 2 bits returned in the info output argument of the nrULSCHInfo function. A value of [] indicates the absence of the CSI part 2 transmission. The nominal values of the CSI part 2 bits are 0, 1, -1, and -2. Nominally, the CSI part 2 is present only when CSI part 1 is present.

    The gcsi2 must be a multiple of the product of the number of transmission layers and the modulation order.

    Data Types: int8 | double

    Output Arguments

    collapse all

    Codeword for the transmission on the PUSCH, returned as a real-valued column vector. If you provide any of the input arguments as data type int8, the output data type of the codeword is int8. The nominal values of the bits in the codewords are 0, 1, -1, and -2.

    The length of cw equals the bit capacity of the PUSCH.

    The cw output is an empty value of size 0-by-1 for all of these cases.

    • When the PRBSet property of the pusch argument is [].

    • When the SymbolAllocation property of the pusch argument is [] or when the number of contiguous OFDM symbols allocated for PUSCH is zero

    • When all of the input arguments culsch, cack, ccsi1, and ccsi2 are empty

    Data Types: int8 | double

    Location information about the 1-based locations of each type in output codeword cw, returned as a structure containing these fields. The output data type of each field is uint32.

    FieldDescription
    ULSCHIndices

    Locations of coded UL-SCH bits in codeword

    ACKIndices

    Locations of coded HARQ-ACK bits in codeword

    CSI1Indices

    Locations of coded CSI part 1 bits in codeword

    CSI2Indices

    Locations of coded CSI part 2 bits in codeword

    UCIXIndices

    Locations of X UCI placeholders in codeword

    UCIYIndices

    Locations of Y UCI placeholders in codeword

    If the returned codeword, cw, is an empty array, each field in this structure is also an empty array.

    References

    [1] 3GPP TS 38.212. “NR; Multiplexing and channel coding.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    [2] 3GPP TS 38.213. “NR; Physical layer procedures for control.” 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