nrPRS
Description
generates positioning reference signal (PRS) symbols sym
= nrPRS(carrier
,prs
)sym
, as defined in
TS 38.211 Section 7.4.1.7.2 [1], for carrier configuration
carrier
and PRS configuration prs
. The function
also handles the conditions related to the mapping of PRS resources to slots, as defined in
TS 38.211 Section 7.4.1.7.4.
specifies options by using one or more name-value arguments. For example,
sym
= nrPRS(carrier
,prs
,Name=Value
)OutputDataType='single'
sets the data type of the output symbols to
single
.
Examples
Generate PRS Symbols for Multiple Resources in Resource Set
Create a default carrier configuration object.
carrier = nrCarrierConfig;
Specify the extended cyclic prefix for a subcarrier spacing of 60 KHz and slot number 92.
carrier.SubcarrierSpacing = 60;
carrier.CyclicPrefix = 'extended';
carrier.NSlot = 92;
Create a default PRS configuration object.
prs = nrPRSConfig;
Set properties that are common to all PRS resources in a resource set.
prs.PRSResourceSetPeriod = [640 0]; prs.PRSResourceRepetition = 8; prs.PRSResourceTimeGap = 4; prs.MutingPattern1 = [1 0 0 1]; prs.MutingBitRepetition = 2; prs.MutingPattern2 = [1 0 1 1 1 0 1 0]; prs.NumRB = 52; prs.RBOffset = 0; prs.CombSize = 2;
Set properties that are unique to each PRS resource in a resource set.
prs.PRSResourceOffset = [0 40 80 120]; prs.NumPRSSymbols = [6 4 12 2]; prs.SymbolStart = 0; prs.REOffset = [0 1 0 1]; prs.NPRSID = 15;
Generate PRS symbols of single
data type with a cell resource format.
sym = nrPRS(carrier,prs,'OutputDataType','single','OutputResourceFormat','cell')
sym=1×4 cell array
{0x1 single} {0x1 single} {3744x1 single} {0x1 single}
Generate PRS Symbols and Indices for Two Resources
Create a default carrier configuration object.
carrier = nrCarrierConfig;
Create a default PRS configuration object.
prs = nrPRSConfig;
Set properties related to the PRS slot configuration.
prs.PRSResourceSetPeriod = [8 0]; % Resource set periodicity of 8 slots and resource set slot offset of 0 slots prs.PRSResourceOffset = [0 4]; % Configure two PRS resources with slot offsets 0 and 4 relative to resource set offset prs.PRSResourceRepetition = 2; % Repeat each PRS resource twice prs.PRSResourceTimeGap = 1; % Configure two PRS resource repetition indices with no time gap
Set properties related to the PRS muting configuration.
prs.MutingPattern1 = [1 1]; % Transmit all PRS resource set instances prs.MutingBitRepetition = 1; % One instance of a PRS resource set corresponding to a single element of MutingPattern1 binary vector prs.MutingPattern2 = [1 0]; % Mute second repetition index of all the PRS resources within an active instance of a PRS resource set
Set properties related to the PRS time-domain allocation.
prs.NumPRSSymbols = [6 12]; prs.SymbolStart = [6 0];
Set properties related to the PRS frequency-domain allocation.
prs.NumRB = 40;
prs.RBOffset = 4;
prs.CombSize = 4;
prs.REOffset = [1 3];
prs.NPRSID = 5; % Set PRS sequence identity
Get the number of orthogonal frequency division multiplexing (OFDM) symbols per slot.
numSymPerSlot = carrier.SymbolsPerSlot;
Set the number of slots to 20.
numSlots = 20;
Map the resource elements (RE) for both of the PRS resources on the carrier resource grid.
grid = complex(zeros(carrier.NSizeGrid*12,carrier.SymbolsPerSlot*numSlots)); for slotIdx = 0:numSlots-1 carrier.NSlot = slotIdx; indCell = nrPRSIndices(carrier,prs,'OutputResourceFormat','cell'); symCell = nrPRS(carrier,prs,'OutputResourceFormat','cell'); slotGrid = nrResourceGrid(carrier); slotGrid(indCell{1}) = 70*symCell{1}; % Resource element mapping of PRS resource 1 with some scaling for plotting purpose slotGrid(indCell{2}) = 250*symCell{2}; % Resource element mapping of PRS resource 2 with some scaling for plotting purpose grid(:,(1:numSymPerSlot)+numSymPerSlot*slotIdx) = slotGrid; end figure image(abs(grid)); axis xy; L = line(ones(2),ones(2),'LineWidth',8); % Generate lines set(L,{'color'},{[0.18 0.51 0.98]; [0.96 0.95 0.11]}); % Set the colors legend('PRS Resource 1','PRS Resource 2'); % Create legend title('PRS Resource Elements'); 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. This function uses only these nrCarrierConfig
object properties.
prs
— PRS configuration parameters
nrPRSConfig
object
PRS configuration parameters, specified as an nrPRSConfig
object. This function
uses only these nrPRSConfig
object properties.
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: OutputDataType='single'
sets the data type of the output
symbols to single
.
OutputDataType
— Data type of output symbols
'double'
(default) | 'single'
Data type of the output symbols, specified as 'double'
or
'single'
.
Data Types: char
| string
OutputResourceFormat
— Output format of PRS symbols
'concatenated'
(default) | 'cell'
Output format of PRS symbols, specified as one of these values.
'concatenated'
— The outputsym
is a single column vector containing all PRS symbols concatenated.'cell'
— The outputsym
is a cell array where each cell corresponds to a single PRS resource.
Data Types: char
| string
Output Arguments
sym
— PRS symbols
column vector | cell array of column vectors
PRS symbols, returned as a column vector or a cell array of column vectors. If this output is a cell array of column vectors, each cell represents the PRS symbols corresponding to each PRS resource in a PRS resource set.
Data Types: single
| double
Complex Number Support: Yes
References
[1] 3GPP TS 38.211. “NR; Physical channels and modulation (Release 16).” 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
datatype
input argument must be compile-time constant. For example,
when specifying 'single'
as the output data type, include
{coder.Constant('OutputDataType'),coder.Constant('single')}
in the
-args
value of the codegen
function. For more
information, see the coder.Constant
(MATLAB Coder) class.
Version History
Introduced in R2021a
See Also
Objects
Functions
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 (한국어)