Main Content

nrPUSCHIndices

Generate PUSCH resource element indices

Description

example

[ind,info,ptrsInd] = nrPUSCHIndices(carrier,pusch) returns ind in matrix form, which contains 1-based physical uplink shared channel (PUSCH) resource element (RE) indices, as defined in TS 38.211 Sections 6.3.1.6 and 6.3.1.7 [1]. The number of columns in ind is equal to the number of configured antenna ports. carrier specifies the carrier configuration parameters for a specific OFDM numerology and pusch specifies the PUSCH configuration. When you enable transform precoding, the output ind contains the combined locations of the data and the phase tracking reference signal (PT-RS). The function also returns the structural information, info, and PT-RS RE indices, ptrsInd. The output info contains information about the associated physical reference signals, bit capacity, and symbol capacity. ptrsInd is a matrix of PT-RS REs within the carrier resource grid. When you enable transform precoding, the output ptrsInd represents the projections of PT-RS locations prior to transform precoding onto the carrier resource grid.

example

[ind,info,ptrsInd] = nrPUSCHIndices(carrier,pusch,Name,Value) specifies output formatting options using one or more name-value pair arguments. Unspecified options take default values.

Examples

collapse all

Create a carrier configuration object with default properties. This object corresponds to a 10 MHz carrier with 15 kHz subcarrier spacing.

carrier = nrCarrierConfig;

Create a PUSCH configuration object with codebook-based transmission. Set the number of antenna ports to 4, modulation scheme to pi/2-BPSK, transmitted precoding matrix indicator to 10, and transform precoding to 0. When transform precoding is 0, the waveform type is cyclic-prefix orthogonal frequency division multiplexing (CP-OFDM). Enable phase tracking reference signal (PT-RS).

pusch = nrPUSCHConfig;
pusch.TransformPrecoding = 0;
pusch.Modulation = 'pi/2-BPSK';
pusch.TransmissionScheme = 'codebook';
pusch.NumAntennaPorts = 4;
pusch.TPMI = 10;
pusch.EnablePTRS = 1;

Generate PUSCH indices and PT-RS indices in subscript form.

[ind,info,ptrsInd] = nrPUSCHIndices(carrier,pusch,'IndexStyle','subscript')
ind = 31096x3 uint32 matrix

    1    1    1
    2    1    1
    3    1    1
    4    1    1
    5    1    1
    6    1    1
    7    1    1
    8    1    1
    9    1    1
   10    1    1
      ⋮

info = struct with fields:
                G: 7774
               Gd: 7774
        NREPerPRB: 156
    DMRSSymbolSet: 2
    PTRSSymbolSet: [0 1 3 4 5 6 7 8 9 10 11 12 13]

ptrsInd = 1352x3 uint32 matrix

    13     1     1
    37     1     1
    61     1     1
    85     1     1
   109     1     1
   133     1     1
   157     1     1
   181     1     1
   205     1     1
   229     1     1
      ⋮

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]

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');

Figure contains an axes. The axes with title PUSCH Resource Elements in Carrier Resource Grid contains an object of type image.

Input Arguments

collapse all

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

Subcarrier spacing in kHz, for all channels and reference signals of the carrier, specified as 15, 30, 60, 120, or 240.

Data Types: double

Cyclic prefix length, specified as one of these options.

  • 'normal' — Use this value to specify normal cyclic prefix. This option corresponds to 14 OFDM symbols in a slot.

  • 'extended' — Use this value to specify extended cyclic prefix. This option corresponds to 12 OFDM symbols in a slot. For the numerologies specified in TS 38.211 Section 4.2, extended cyclic prefix length applies for only 60 kHz subcarrier spacing.

Data Types: char | string

Number of RBs in the carrier resource grid, specified as an integer from 1 to 275. The default value of 52 corresponds to the maximum number of RBs of a 10 MHz carrier with 15 kHz SCS.

Data Types: double

Start of carrier resource grid relative to CRB 0, specified as an integer from 0 to 2199. This property is the higher-layer parameter offsetToCarrier.

Data Types: double

Slot number, specified as a nonnegative integer. You can set NSlot to a value larger than the number of slots per frame. For example, you can set this value using transmission loop counters in a MATLAB® simulation. In this case, you may have to ensure that the property value is modulo the number of slots per frame in a calling code.

Data Types: double

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

Number of PRBs in bandwidth part (BWP), specified as an integer from 1 to 275. Use [] to set this property to the NSizeGrid property of the nrCarrierConfig object.

Data Types: double

Starting PRB index of BWP relative to common resource block 0 (CRB 0), specified as an integer from 0 to 2473. Use [] to set this property to the NStartGrid property of the nrCarrierConfig object.

Data Types: double

Modulation scheme, specified as 'QPSK', 'pi/2-BPSK', '16QAM', '64QAM', or '256QAM', a string scalar, or a character array.

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 1, 2, 3, or 4.

Data Types: double

Mapping type of the physical shared channel, specified as 'A' or 'B'.

Data Types: char | string

OFDM symbol allocation of the physical shared channel, specified as a two-element vector of nonnegative integers. The first element of this property represents the start of symbol allocation (0-based). The second element represents the number of allocated OFDM symbols.

When you set this property to [] or the second element of the vector to 0, no symbol is allocated for the channel.

Data Types: double

Physical resource block (PRB) allocation of the PUSCH within the BWP, specified as a vector of integers from 0 to 274.

Data Types: double

Transform precoding, specified as one of these values.

  • 0 (false) — Disable transform precoding. The waveform type is cyclic-prefix orthogonal frequency division multiplexing (CP-OFDM).

  • 1 (true) — Enable transform precoding. The waveform type is discrete Fourier transform spread orthogonal frequency division multiplexing (DFT-s-OFDM).

Data Types: double | logical

PUSCH transmission scheme, specified as 'nonCodebook' or 'codebook'.

Data Types: char | string

Number of antenna ports, specified as 1, 2, or 4. This value must be greater than or equal to the NumLayers property.

Dependencies

This property is applicable only when TransmissionScheme is set to 'codebook'.

Data Types: double

Transmitted precoding matrix indicator, specified as an integer from 0 to 27.

Dependencies

This property is applicable only when TransmissionScheme is set to 'codebook'.

Data Types: double

Frequency hopping for the physical uplink shared channel, specified as 'neither', 'intraSlot', or 'interSlot'.

Data Types: char | string

Starting PRB index of the second hop relative to the BWP, specified as an integer from 0 to 274.

Dependencies

This property is applicable only when FrequencyHopping is set to 'intraSlot' or 'interSlot'.

Data Types: double

Radio network temporary identifier of the user equipment (UE), specified as an integer from 0 to 65,535.

Data Types: double

PUSCH DM-RS configuration parameters, specified as an nrPUSCHDMRSConfig object. This function uses only these nrPUSCHDMRSConfig properties.

DM-RS configuration type, specified as 1 or 2. This property is the higher-layer parameter dmrs-Type.

This property value must be 1 when nrPUSCHDMRSConfig is a property of nrPUSCHConfig with TransformPrecoding property set to 1.

Data Types: double

Position of first DM-RS OFDM symbol, provided by higher layer parameter dmrs-TypeA-Position, specified as 2 or 3.

This property is applicable when nrPUSCHDMRSConfig is a property of nrPUSCHConfig object with MappingType property value set to 'A'.

Data Types: double

Maximum number of DM-RS additional positions, specified as 0, 1, 2, or 3. This property is the higher layer parameter dmrs-AdditionalPosition.

This property value must be 0 or 1 when nrPUSCHDMRSConfig is a property of nrPUSCHConfig object with FrequencyHopping property set to 'intraSlot'.

Data Types: double

Number of consecutive front-loaded DM-RS OFDM symbols, specified as 1 (single-symbol DM-RS) or 2 (double-symbol DM-RS).

This property value must be 1 when nrPUSCHDMRSConfig is a property of nrPUSCHConfig object with FrequencyHopping property set to 'intraSlot'.

Data Types: double

DM-RS OFDM symbol locations that are 0-based, specified as one of these options.

  • Integer from 0 to 13 — For one DM-RS symbol

  • Vector of nonnegative integers from 0 to 13 — For multiple DM-RS symbols

Each input symbol location is assumed to be a single-symbol DM-RS within the physical shared channel symbol allocation.

The default value, [], corresponds to the DM-RS symbols locations as per TS 38.211 Table 6.4.1.1.3-3, 6.4.1.1.3-4, or 6.4.1.1.3-6 [1]. Setting this property overrides the corresponding DM-RS symbol locations in these standard lookup tables.

Data Types: double

DM-RS antenna ports, specified as one of these options.

  • Integer from 0 to 11 — For a single antenna port

  • Vector of nonnegative integers from 0 to 11 — For multiple antenna ports

Nominal antenna ports supported depend on DMRSLength and DMRSConfigurationType property values, as shown in this table.

DMRSLength ValueDMRSConfigurationType ValueNominal Range of Antenna Ports Supported
11[0, 3]
2[0, 5]
21[0, 7]
2[0, 11]

The default value of [] implies that DM-RS antenna port is equal to 0.

When nrPUSCHDMRSConfig is a property of nrPUSCHConfig object, [] implies that DMRSPortSet is in the range from 0 to NumLayers–1.

Data Types: double

Number of DM-RS CDM groups without data, specified as 1, 2, or 3.

Each value indicates a different set of CDM group numbers, according to TS 38.214 Section 6.2.2 [2].

  • 1 — CDM group number 0

  • 2 — CDM group numbers 0 and 1

  • 3 — CDM group numbers 0, 1, and 2

When TransformPrecoding property of the nrPUSCHConfig object is set to 1, this property value must be 2.

Data Types: double

Enable the PT-RS, specified as one of these values.

  • 0 (false) — Disable the PT-RS configuration.

  • 1 (true) — Enable the PT-RS configuration.

Data Types: double | logical

PUSCH PT-RS configuration, specified as an nrPUSCHPTRSConfig object. This function uses only these nrPUSCHPTRSConfig properties.

PT-RS time density, specified as 1, 2 or 4. This property is the higher layer parameter timeDensity.

Data Types: double

PT-RS frequency density, specified as 2 or 4. This property is the higher layer parameter frequencyDensity.

Dependencies

This property applies only when nrPUSCHPTRSConfig is a property of nrPUSCHConfig with TransformPrecoding set to 0.

Data Types: double

PT-RS antenna port set, specified as a two-element vector of nonnegative integers. Specify [] to set this property to the lowest value in the DMRSPortSet property of nrPUSCHDMRSConfig object. This usage of [] value is applicable only when nrPUSCHDMRSConfig object is used as a property of nrPUSCHConfig object.

Dependencies

This property applies only when nrPUSCHPTRSConfig is a property of nrPUSCHConfig with TransformPrecoding set to 0.

Data Types: double

Number of PT-RS samples per PT-RS group, specified as 2 or 4. This property is the higher layer parameter sampleDensity.

Dependencies

This property applies only when nrPUSCHPTRSConfig is a property of nrPUSCHConfig with TransformPrecoding set to 1.

Data Types: double

Number of PT-RS groups, specified as 2, 4, or 8. This property is the higher layer parameter sampleDensity.

When this property is set to 8, the number of PT-RS samples set by the NumPTRSSamples property must be set to 4.

Dependencies

This property applies only when nrPUSCHPTRSConfig is a property of nrPUSCHConfig with TransformPrecoding set to 1.

Data Types: double

Resource element offset, specified as '00', '01','10', or '11'. This property is the higher layer parameter resourceElementOffset.

Dependencies

This property applies only when nrPUSCHPTRSConfig is a property of nrPUSCHConfig with TransformPrecoding set to 0.

Data Types: char | string

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'IndexStyle','subscript','IndexBase','0based' specifies the RE indexing form and base, respectively, of the output.

RE indexing form, specified as one of these values:

  • 'index' — The indices are in linear index form.

  • 'subscript' — The indices are in [subcarrier, symbol, antenna] subscript row form.

Data Types: char | string

RE indexing base, specified as one of these values:

  • '1based' — The index counting starts from 1.

  • '0based' — The index counting starts from 0.

Data Types: char | string

Resource element indexing orientation, specified as the comma-separated pair consisting of 'IndexOrientation' and one of these values:

  • 'carrier' — Indices are referenced with respect to the carrier grid.

  • 'bwp' — Indices are referenced with respect to the BWP.

Dependencies

This property is applicable only when TransformPrecoding property of nrPUSCHConfig object is set to 0.

Data Types: char | string

Output Arguments

collapse all

PUSCH RE indices, returned as one of these values.

  • N-by-P matrix — The function returns this type of value when you set 'IndexStyle' to 'index'. The number of columns depends on the TransmissionScheme property of the nrPUSCHConfig object and is returned as one these values.

    • Number of transmission layers — When the transmission scheme is noncodebook

    • Number of antenna ports configured — When the transmission scheme is codebook

  • M-by-3 matrix — The function returns this type of value when you set 'IndexStyle' to 'subscript'. The matrix rows correspond to the [subcarrier, symbol, antenna] subscripts based on the number of subcarriers, OFDM symbols, and number of antennas, respectively.

Depending on the value of 'IndexBase', the function returns either 1-based or 0-based indices. Depending on the value of 'IndexOrientation', the function returns either carrier-oriented indices or BWP-oriented indices.

Data Types: uint32

PUSCH resource information, returned as a structure containing these fields.

FieldDescription
G

Bit capacity of the PUSCH. This value must be equal to the length of the codeword from the uplink shared channel (UL-SCH) transport channel.

Gd

Number of REs per layer or port

DMRSSymbolSet

The OFDM symbol locations in a slot containing the demodulation reference signal (DM-RS). The symbols are 0-based.

NREPerPRB

Number of REs per PRB allocated to the PUSCH

PTRSSymbolSet

The OFDM symbol locations in a slot containing the phase tracking reference signal (PT-RS). The symbols are 0-based.

PT-RS RE indices, returned as one of these values.

  • N-by-P matrix — The function returns this type of value when you set 'IndexStyle' to 'index'. The number of columns depends on the TransmissionScheme property of the nrPUSCHConfig object and is returned as one these values.

    • Number of transmission layers — When the transmission scheme is noncodebook

    • Number of antenna ports configured — When the transmission scheme is codebook

  • M-by-3 matrix — The function returns this type of value when you set 'IndexStyle' to 'subscript'. The matrix rows correspond to the [subcarrier, symbol, antenna] subscripts based on the number of subcarriers, OFDM symbols, and number of antennas, respectively.

Depending on the value of 'IndexBase', the function returns either 1-based or 0-based indices. Depending on the value of 'IndexOrientation', the function returns either carrier-oriented indices or BWP-oriented indices.

Data Types: uint32

References

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

Extended Capabilities

Introduced in R2020a