Generate PUSCH resource element indices
[
returns ind
,info
] = nrPUSCHIndices(carrier
,pusch
)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. The
function also returns the structure info
, which contains additional
information about the associated physical reference signals, bit capacity, and symbol
capacity.
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).
pusch = nrPUSCHConfig; pusch.TransformPrecoding = 0; pusch.Modulation = 'pi/2-BPSK'; pusch.TransmissionScheme = 'codebook'; pusch.NumAntennaPorts = 4; pusch.TPMI = 10;
Generate PUSCH indices in subscript form.
[ind,info] = nrPUSCHIndices(carrier,pusch,'IndexStyle','subscript')
ind = 32448x3 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: 8112
Gd: 8112
NREPerPRB: 156
DMRSSymbolSet: 2
PTRSSymbolSet: [1x0 double]
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');
carrier
— Carrier configuration parametersnrCarrierConfig
objectCarrier configuration parameters for a specific OFDM numerology, specified as an nrCarrierConfig
object. This function uses only these properties of the nrCarrierConfig
object.
Property Field | Values | Description |
---|---|---|
SubcarrierSpacing | 15 (default), 30, 60, 120, 240 | Subcarrier spacing in kHz |
CyclicPrefix | 'normal' (default), 'extended' | Cyclic prefix length, specified as one of these options.
For the numerologies specified in TS 38.211 Section 4.2, extended cyclic prefix length applies only for 60 kHz subcarrier spacing. |
NSizeGrid | 52 (default), integer from 1 to 275 | Number of resource blocks in the carrier resource grid |
NStartGrid | 0 (default), integer from 0 to 2199 | Start of carrier resource grid relative to common resource block 0 (CRB 0) |
NSlot | 0 (default), nonnegative integer scalar | Slot number. You can set |
pusch
— PUSCH configuration parametersnrPUSCHConfig
objectPUSCH configuration parameters, specified as an nrPUSCHConfig
object. This function only uses these nrPUSCHConfig
object
properties.
Property Field | Values | Description |
---|---|---|
NSizeBWP |
| Size of the bandwidth part (BWP) in terms of number of physical
resource blocks (PRBs). The default value of |
NStartBWP |
| Starting PRB index of BWP relative to CRB 0. The default value of
|
Modulation | 'QPSK', '16QAM', '64QAM', or '256QAM', 'pi/2-BPSK', string scalar, or character array | Modulation scheme of codeword |
NumLayers | 1 (default), integer from 1 to 4 | Number of transmission layers |
MappingType | 'A' (default), 'B' | Mapping type of PUSCH |
SymbolAllocation | [0 14] (default), two-element vector of nonnegative integers | OFDM symbols allocated for PUSCH |
PRBSet | [0:51] (default), vector of nonnegative integers from 0 to 274 | PRBs allocated for PUSCH within the BWP |
TransformPrecoding | 0 (default), 1 | Transform precoding flag, specified as one of these values.
|
TransmissionScheme |
| PUSCH transmission scheme |
NumAntennaPorts | 1 (default), 2, or 4 | Number of antenna ports. The value must be greater than or equal to
|
FrequencyHopping |
| Frequency hopping mode for PUSCH |
SecondHopStartPRB | 1 (default), integer from 0 to 274 | Starting PRB index of second hop relative to
|
RNTI | 1 (default), integer from 0 to 65,535 | Radio network temporary identifier of the user equipment |
DMRS |
|
For more information, see |
EnablePTRS | 0 (default), 1 | PT-RS configuration, specified as one of these values.
|
PTRS |
|
For more information, see |
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
.
'IndexStyle','subscript','IndexBase','0based'
specifies the
RE indexing form and base, respectively, of the output.'IndexStyle'
— Resource element indexing form'index'
(default) | 'subscript'
Resource element indexing form, specified as the comma-separated pair consisting of
'IndexStyle'
and 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
'IndexBase'
— Resource element indexing base'1based'
(default) | '0based'
Resource element indexing base, specified as the comma-separated pair consisting of
'IndexBase'
and one of these values:
'1based'
— The index counting starts from one.
'0based'
— The index counting starts from zero.
Data Types: char
| string
'IndexOrientation'
— Resource element indexing orientation'carrier'
(default) | 'bwp'
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.
This property is applicable only when TransformPrecoding
property of nrPUSCHConfig
object is set to
0
.
Data Types: char
| string
ind
— PUSCH resource element indicesPUSCH resource element indices, returned as one of these values.
N-by-P matrix — The function returns
this type of value when 'IndexStyle'
is set to
'index'
.
M-by-3 matrix — The function returns this type of value
when 'IndexStyle'
is set 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
info
— PUSCH resource informationPUSCH resource information, returned as a structure containing these fields.
Field | Description |
---|---|
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. |
[1] 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
Usage notes and limitations:
Names
and values in name-value pair arguments must be compile-time constants. For example, to specify
linear indexing form, include
{coder.Constant('IndexStyle'),coder.Constant('index')}
in the
-args
value of the codegen
function. For more
information, see the coder.Constant
(MATLAB Coder) class.
You have a modified version of this example. Do you want to open this example with your edits?