Main Content

nrPUSCH

Generate PUSCH modulation symbols

Description

example

[sym,ptrsSym] = nrPUSCH(cw,mod,nLayers,nid,rnti) returns physical uplink shared channel (PUSCH) modulation symbols, as defined in TS 38.211 Sections 6.3.1.1 to 6.3.1.5 [1]. The process consists of scrambling with scrambling identity nid, performing symbol modulation with modulation scheme mod, and layer mapping. cw specifies an uplink shared channel (UL-SCH) codeword, as described in TS 38.212 Section 6.2.7 [2]. nLayers specifies the number of transmission layers. rnti is the radio network temporary identifier (RNTI) of the user equipment (UE). When you use this syntax, the output ptrsSym is empty.

[sym,ptrsSym] = nrPUSCH(cw,mod,nLayers,nid,rnti,transformPrecode,mrb) specifies transform precoding as a logical value. When transformPrecode is set to true, the function applies the transform precoding defined in TS 38.211 Section 6.3.1.4. mrb specifies the allocated number of PUSCH resource blocks. When you use this syntax, the output ptrsSym is empty.

example

[sym,ptrsSym] = nrPUSCH(cw,mod,nLayers,nid,rnti,transformPrecode,mrb,txScheme,nPorts,tpmi) specifies the transmission scheme. When txScheme is set to 'codebook', the function performs multi-input multi-output (MIMO) precoding based on the specified number of layers nLayers, number of antenna ports nPorts, and the transmitted precoding matrix indicator (TPMI) tpmi. When you use this syntax, the output ptrsSym is empty.

example

[sym,ptrsSym] = nrPUSCH(carrier,pusch,cw) returns PUSCH modulation symbols, sym, for the specified carrier configuration carrier and PUSCH configuration pusch. The input cw specifies one or two UL-SCH codewords. The function also returns the precoded phase tracking reference signals (PT-RS) symbols, ptrsSym, which are mapped to the resource grid. When you use this syntax with transform precoding, the function maps the data modulated symbols and PT-RS symbols at appropriate locations prior to starting the transform precoding process.

example

[sym,ptrsSym] = nrPUSCH(___,'OutputDataType',datatype) specifies the data type for the PUSCH symbols and PT-RS symbols in addition to specifying an input combination from any of the previous syntaxes.

Examples

collapse all

Specify a random sequence of binary values corresponding to a codeword of 8064 bits.

cw = randi([0 1],8064,1);

Using 16-QAM modulation, generate PUSCH modulation symbols for the specified physical layer cell identity number, RNTI, and two transmission layers. By default, the function disables transform precoding and noncodebook-based transmission.

modulation = '16QAM';
nlayers = 2;
ncellid = 17;
rnti = 111;
sym = nrPUSCH(cw,modulation,nlayers,ncellid,rnti)
sym = 1008×2 complex

  -0.9487 - 0.9487i  -0.3162 + 0.3162i
   0.3162 + 0.3162i  -0.9487 - 0.3162i
   0.3162 + 0.3162i   0.3162 - 0.3162i
   0.9487 - 0.3162i  -0.3162 + 0.9487i
  -0.3162 - 0.9487i   0.3162 - 0.9487i
  -0.3162 + 0.9487i   0.3162 - 0.3162i
   0.3162 + 0.3162i   0.9487 - 0.9487i
  -0.9487 + 0.9487i  -0.3162 + 0.3162i
   0.9487 - 0.9487i  -0.9487 - 0.3162i
  -0.9487 - 0.9487i   0.3162 + 0.9487i
      ⋮

Specify a random sequence of binary values corresponding to a codeword of 8064 bits.

cw = randi([0 1],8064,1);

Using 256-QAM modulation, generate PUSCH modulation symbols for the specified physical layer cell identity number, RNTI, bandwidth, and one transmission layer. Enable transform precoding and codebook-based transmission based on the specified TPMI and four antennas.

modulation = '256QAM';
ncellid = 17;
rnti = 111;
mrb = 6;
nlayers = 1;
transformPrecode = true;
txScheme = 'codebook';
tpmi = 1;
nports = 4;
sym = nrPUSCH(cw,modulation,nlayers,ncellid,rnti,transformPrecode,mrb,txScheme,nports,tpmi)
sym = 1008×4 complex

   0.0000 + 0.0000i   0.2169 + 0.2350i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i   0.2296 + 0.3713i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i  -0.0797 - 0.9008i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i  -0.4767 - 0.0143i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i   0.4124 + 0.2638i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i  -0.1433 - 0.2366i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i   0.0885 - 0.1080i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i   0.5507 - 0.1894i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i  -0.3039 - 0.9165i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i  -0.1498 + 0.3356i   0.0000 + 0.0000i   0.0000 + 0.0000i
      ⋮

Create a carrier configuration object with default properties. This object corresponds to 30 kHz of subcarrier spacing and 20 MHz transmission bandwidth.

carrier = nrCarrierConfig;
carrier.SubcarrierSpacing = 30;
carrier.NSizeGrid = 51;

Create a PUSCH configuration object with specified properties. When transform precoding is 1, the waveform type is discrete fourier transform spread orthogonal frequency division multiplexing (DFT-s-OFDM).

pusch = nrPUSCHConfig;
pusch.NStartBWP = 10;
pusch.NSizeBWP = 41;
pusch.Modulation = '16QAM';
pusch.NID = []; % Set NID equal to the NCellID property of carrier.
pusch.PRBSet = 0:5;
pusch.TransformPrecoding = 1;
pusch.FrequencyHopping = 'intraSlot';
pusch.SecondHopStartPRB = 3;

Generate PUSCH indices, setting the index orientation with respect to the carrier grid.

[ind,info] = nrPUSCHIndices(carrier,pusch,'IndexOrientation','carrier')
ind = 864x1 uint32 column vector

   121
   122
   123
   124
   125
   126
   127
   128
   129
   130
      ⋮

info = struct with fields:
                G: 3456
               Gd: 864
        NREPerPRB: 144
    DMRSSymbolSet: [2 7]
    PTRSSymbolSet: [1x0 double]
           PRBSet: [0 1 2 3 4 5]

Generate PUSCH symbols of data type single.

numDataBits = info.G;
cws = randi([0 1],numDataBits,1);
sym = nrPUSCH(carrier,pusch,cws,'OutputDataType','single')
sym = 864x1 single column vector

  -0.7454 + 0.2981i
   0.3406 - 0.2312i
  -0.1153 + 0.2756i
   1.1921 - 0.3658i
  -0.3968 - 0.0277i
  -0.8788 - 0.6493i
  -0.8737 + 0.8318i
  -0.5764 + 0.0269i
  -1.6638 + 0.0482i
  -1.0270 - 0.1347i
      ⋮

Plot the generated symbols and indices on the carrier resource grid.

grid = complex(zeros([carrier.NSizeGrid*12 carrier.SymbolsPerSlot pusch.NumLayers]));
grid(ind) = sym;
imagesc(abs(grid(:,:,1)));
axis xy;
xlabel('OFDM Symbols');
ylabel('Subcarriers');
title('PUSCH Resource Elements in Carrier Resource Grid');

Specify a random sequence of binary values corresponding to a codeword of 4032 bits.

cw = randi([0 1],4032,1);

Create a carrier configuration object with 30 kHz subcarrier spacing and 20 MHz transmission bandwidth.

carrier = nrCarrierConfig;
carrier.SubcarrierSpacing = 30;
carrier.NSizeGrid = 51;

Create a PUSCH configuration object with these specified properties.

pusch = nrPUSCHConfig;
pusch.NStartBWP = 10;
pusch.NSizeBWP = 41;
pusch.Modulation = '64QAM';
pusch.PRBSet = 0:5;
pusch.TransformPrecoding = 1;
pusch.FrequencyHopping = 'intraSlot';
pusch.EnablePTRS = 1;

Create a PUSCH phase tracking reference signal (PT-RS) configuration object with these specified properties.

ptrs = nrPUSCHPTRSConfig;
ptrs.TimeDensity = 2;
ptrs.NumPTRSSamples = 4;
ptrs.NumPTRSGroups = 8;
ptrs.NID = 750;

Assign the PUSCH PT-RS configuration object to the PTRS property of the PUSCH configuration object.

pusch.PTRS = ptrs;

Generate PUSCH PT-RS symbols.

[sym,ptrsSym] = nrPUSCH(carrier,pusch,cw)
sym = 864×1 complex

   0.0000 - 0.3273i
  -0.0879 - 0.3552i
   0.4931 + 0.1194i
  -1.4765 - 0.6074i
  -0.1208 + 0.1961i
   0.8119 - 0.3622i
  -0.4653 + 0.0519i
   0.7790 + 0.9679i
   1.2730 + 1.0205i
  -1.6337 + 0.6741i
      ⋮

ptrsSym = 192×1 complex

   0.0000 - 0.3273i
  -0.0879 - 0.3552i
   0.4931 + 0.1194i
  -1.4765 - 0.6074i
  -0.5758 + 0.1331i
   2.2422 + 0.5442i
  -1.1968 + 1.4190i
   0.7160 + 0.7333i
  -0.7518 - 0.5147i
   1.3432 - 0.0623i
      ⋮

Input Arguments

collapse all

UL-SCH codewords from TS 38.212 Section 6.2.7, specified as a column vector representing one UL-SCH codeword or a cell array of one or two column vectors representing one or two UL-SCH codewords. The vector elements must be integers from –2 to 1.

  • 0 and 1 represent false and true bit values, respectively.

  • –1 and –2 represent x and y placeholders in the uplink control information (UCI), respectively. For more details, see TS 38.212 Sections 5.3.3.1 and 5.3.3.2.

Data Types: double | int8

Modulation scheme, specified as 'pi/2-BPSK', 'QPSK', '16QAM', '64QAM', or '256QAM'. This modulation scheme determines the modulation type and number of bits used per modulation symbol.

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

Data Types: char | string

Number of transmission layers, specified as an integer from 1 to 4. For more information, see TS 38.211 Section 6.3.1.3.

Data Types: double

Scrambling identity, specified as an integer from 0 to 1023. nid is higher layer parameter dataScramblingIdentityPUSCH, ranging from 0 to 1023, if the higher layer parameter is configured. Otherwise, nid is physical layer cell identity number NCellID, ranging from 0 to 1007. For more information, see TS 38.211 Section 6.3.1.1.

Data Types: double

RNTI of the UE, specified as an integer from 0 to 65,535.

Data Types: double

Transform precoding, specified as false or true. For more information, see TS 38.211 Section 6.3.1.4.

Data Types: double | logical

Number of allocated PUSCH resource blocks, specified as an integer from 1 to 275. For more information, see TS 38.214 Section 6.1.2.

Data Types: double

Transmission scheme, specified as one of these values:

  • 'nonCodebook' — Use this option to disable MIMO precoding.

  • 'codebook' — Use this option for codebook-based transmission using MIMO precoding.

For more information, see TS 38.211 Section 6.3.1.4.

Data Types: char | string

Transmitted precoding matrix indicator, specified as an integer from 0 to 27. The valid range of tpmi depends on the specified number of transmission layers, nLayers, and number of antenna ports, nPorts. For more information, see TS 38.211 Tables 6.3.1.5-1 to 6.3.1.5-7.

Data Types: double

Number of antenna ports, specified as 1 , 2, or 4. For more information, see TS 38.211 Section 6.3.1.5.

Data Types: double

Data type of the output symbols, specified as 'double' or 'single'.

Data Types: char | string

Carrier configuration parameters for a specific OFDM numerology, specified as an nrCarrierConfig object. This function uses only these properties of the nrCarrierConfig object.

PUSCH configuration parameters for a specific OFDM numerology, specified as an nrPUSCHConfig object. This function uses only these properties of the nrPUSCHConfig object.

For operation with shared spectrum channel access for frequency range 1 (FR1), set the Interlacing property to true, then use the RBSetIndex and InterlaceIndex object properties to specify the allocated frequency resources. (since R2023b)

Output Arguments

collapse all

PUSCH modulation symbols, returned as a complex matrix.

  • If you set the txScheme input to 'codebook', the number of matrix columns is nPorts. If you set the txScheme input to 'nonCodebook', the number of matrix columns is nLayers.

  • For the function syntax that uses the carrier and pusch inputs:

    • If you set the pusch.TransmissionScheme property to 'codebook', the number of matrix columns is pusch.NumAntennaPorts.

    • If you set the pusch.TransmissionScheme property to 'nonCodebook', the number of matrix columns is pusch.NumLayers.

    When you enable transform precoding, the output sym represents all of the post transform precoding data modulated symbols and PT-RS symbols.

Data Types: single | double
Complex Number Support: Yes

PT-RS symbols mapped to the resource grid, returned as a complex matrix. When you enable transform precoding, the output ptrsSym is the subset of output sym, at the PT-RS locations prior to transform precoding process. The output ptrsSym returns an empty value when you do not specify the pusch input argument.

Data Types: single | double
Complex Number Support: Yes

References

[1] 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

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

Extended Capabilities

Version History

Introduced in R2019a

expand all