nrCSIRSIndices
Generate CSI-RS resource element indices
Syntax
Description
[
returns resource element indices ind
,info
] = nrCSIRSIndices(carrier
,csirs
)ind
for the channel state information
reference signal (CSI-RS), as defined in TS 38.211 Section 7.4.1.5.3 [1]. The input
carrier
specifies carrier configuration parameters for a specific
OFDM numerology. The input csirs
specifies CSI-RS resource
configuration parameters for one or more zero-power (ZP) or non-zero-power (NZP) CSI-RS
resources. When configuring both ZP and NZP resources, the returned indices are in the order
ZP followed by NZP, irrespective of the resource order specified by
csirs
.
The
function also returns the structure info
, which contains additional
information about the CSI-RS locations.
[
specifies output formatting options by using one or more name-value pair arguments.
Unspecified options take default values.ind
,info
] = nrCSIRSIndices(carrier
,csirs
,Name,Value
)
Examples
Generate CSI-RS Symbols and Indices for 10 MHz Carrier
Create a carrier configuration object with default properties. This object corresponds to a 10 MHz carrier.
carrier = nrCarrierConfig;
Create a CSI-RS configuration object with default properties.
csirs = nrCSIRSConfig;
Generate CSI-RS symbols of single
data type.
[sym,info_sym] = nrCSIRS(carrier,csirs,'OutputDataType','single');
Generate resource element indices for CSI-RS.
[ind,info_ind] = nrCSIRSIndices(carrier,csirs);
Generate ZP and NZP-CSI-RS Symbols and Indices
Create a carrier configuration object, specifying the slot number as 10
.
carrier = nrCarrierConfig('NSlot',10);
Create a CSI-RS resource configuration object for two periodic resources. Specify one NZP resource and one ZP resource with row numbers 3
and 5
, symbol locations 13
and 9
, and subcarrier locations 6
and 4
, respectively. For both resources, set the periodicity to 5
, offset to 1
, and density to 'one'
.
csirs = nrCSIRSConfig; csirs.CSIRSType = {'nzp','zp'}; csirs.CSIRSPeriod = {[5 1],[5 1]}; csirs.RowNumber = [3 5]; csirs.Density = {'one','one'}; csirs.SymbolLocations = {13,9}; csirs.SubcarrierLocations = {6,4};
Generate CSI-RS symbols and indices for the specified carrier, CSI-RS resource configuration, and output formatting name-value pair arguments. Verify the format of the symbols and indices.
[sym,info_sym] = nrCSIRS(carrier,csirs, ... 'OutputResourceFormat','cell')
sym=1×2 cell array
{0x1 double} {0x1 double}
info_sym = struct with fields:
ResourceOrder: [2 1]
KBarLBar: {{1x1 cell} {1x2 cell}}
CDMGroupIndices: {[0] [0 1]}
KPrime: {[0 1] [0 1]}
LPrime: {[0] [0]}
[ind,info_ind] = nrCSIRSIndices(carrier,csirs, ... 'IndexStyle','subscript','OutputResourceFormat','cell')
ind=1×2 cell array
{0x3 uint32} {0x3 uint32}
info_ind = struct with fields:
ResourceOrder: [2 1]
KBarLBar: {{1x1 cell} {1x2 cell}}
CDMGroupIndices: {[0] [0 1]}
KPrime: {[0 1] [0 1]}
LPrime: {[0] [0]}
Verify that the generated outputs are in the order of ZP-CSI-RS resources followed by NZP-CSI-RS resources in terms of the specified csirs.CSIRSType
indices.
info_sym.ResourceOrder
ans = 1×2
2 1
info_ind.ResourceOrder
ans = 1×2
2 1
Generate and Map CSI-RS Symbols Used for Tracking
Create a carrier configuration object with default properties.
carrier = nrCarrierConfig;
Create a CSI-RS resource configuration object with CSI-RS parameters set for tracking. Specify four periodic NZP-CSI-RS resources in two consecutive slots. Specify for each slot to contain two periodic NZP-CSI-RS resources with periodicity set to 20
. Set the offset for the first two resources to 0
. Set the offset for the next two resources to 1
. Set the row number to 1
and density to 'three'
for all resources.
csirs = nrCSIRSConfig; csirs.CSIRSType = {'nzp','nzp','nzp','nzp'}; csirs.CSIRSPeriod = {[20 0],[20 0],[20 1],[20 1]}; csirs.RowNumber = [1 1 1 1]; csirs.Density = {'three','three','three','three'}; csirs.SymbolLocations = {6,10,6,10}; csirs.SubcarrierLocations = {0,0,0,0};
Generate CSI-RS symbols and indices for the default slot number of the carrier configuration object (slot number 0).
ind0 = nrCSIRSIndices(carrier,csirs); sym0 = nrCSIRS(carrier,csirs);
Map the symbols to a carrier grid of one slot duration.
gridSize = [12*carrier.NSizeGrid carrier.SymbolsPerSlot max(csirs.NumCSIRSPorts)]; slotgrid0 = complex(zeros(gridSize)); slotgrid0(ind0) = sym0;
Change the absolute slot number in the carrier configuration from 0
to 1
.
carrier.NSlot = 1;
Generate CSI-RS symbols and indices for slot number 1.
ind1 = nrCSIRSIndices(carrier,csirs); sym1 = nrCSIRS(carrier,csirs);
Map the symbols to another carrier grid of one slot duration.
slotgrid1 = complex(zeros(gridSize)); slotgrid1(ind1) = sym1;
Concatenate the two slots to form the final grid.
grid = [slotgrid0 slotgrid1];
Plot the grid.
imagesc(abs(grid(:,:,1))); axis xy; title('CSI-RS as Tracking Reference Signal'); xlabel('OFDM Symbols'); ylabel('Subcarriers');
Input Arguments
carrier
— Carrier configuration parameters
nrCarrierConfig
object
Carrier configuration parameters for a specific OFDM numerology, specified as an nrCarrierConfig
object.
csirs
— CSI-RS resource configuration parameters
nrCSIRSConfig
object
CSI-RS resource configuration parameters, specified as an nrCSIRSConfig
object.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'IndexStyle','subscript','IndexBase','0based'
specifies the
indexing style and indexing base of the output.
IndexStyle
— RE indexing form
'index'
(default) | 'subscript'
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
IndexBase
— RE indexing base
'1based'
(default) | '0based'
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
OutputResourceFormat
— Output format of CSI-RS resource element indices
'concatenated'
(default) | 'cell'
Output format of CSI-RS resource element indices, specified as the comma-separated
pair consisting of 'OutputResourceFormat'
and one of these values:
'concatenated'
— The outputind
is a single column vector containing all CSI-RS resource element indices concatenated.'cell'
— The outputind
is a cell array where each cell corresponds to a single CSI-RS resource.
Data Types: char
| string
Output Arguments
ind
— CSI-RS resource element indices
column vector | M-by-3 matrix | cell array
CSI-RS resource element indices, returned as one of these values:
Column vector — The function returns this type of value when '
OutputResourceFormat
' is set to'concatenated'
and 'IndexStyle
' is set to'index'
.M-by-3 matrix — The function returns this type of value when '
OutputResourceFormat
' is set to'concatenated'
and '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.Cell array — The function returns this type of value when '
OutputResourceFormat
' is set to'cell'
. If 'IndexStyle
' is set to'index'
, each cell is a column vector. If 'IndexStyle
' is set to'subscript'
, each cell is an M-by-3 matrix.
Depending on the value of 'IndexBase
', the function returns
either 1-based or 0-based indices.
Data Types: uint32
info
— CSI-RS locations information
structure
CSI-RS locations information, returned as a structure containing these fields:
Fields | Description |
---|---|
ResourceOrder | Order of CSI-RS resources in terms of
|
KBarLBar | Frequency-domain and time-domain locations of the lowest resource elements corresponding to all code division multiplexing (CDM) groups |
CDMGroupIndices | CDM group indices |
KPrime | Frequency-domain indexing within a CDM group |
LPrime | Time-domain indexing within a CDM group |
Each field, apart from ResourceOrder
, returns the information in
the resource order specified by the CSIRSType
property of the input
csirs
configuration object. These fields represent the
frequency-domain and time-domain locations of the CSI-RS within a slot for each
resource, as defined in TS 38.211 Table 7.4.1.5.3-1.
References
[1] 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
The
'OutputResourceFormat'
name-value argument must be compile-time
constant for code generation. For example, when you call the function with
'OutputResourceFormat','concatenated'
, include
{coder.Constant('OutputResourceFormat'),coder.Constant('concatenated')}
in the -args
value of the codegen
function. For more
information, see the coder.Constant
(MATLAB Coder) class.
Version History
Introduced in R2019bR2023a: C/C++ code generation updates
For C/C++ code generation, the limitation to specify 'IndexStyle'
or 'IndexBase'
name-value arguments as compile-time constants has been
removed.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)