Main Content

nrPRS

Generate PRS symbols

Since R2021a

    Description

    sym = nrPRS(carrier,prs) generates positioning reference signal (PRS) symbols 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.

    example

    sym = nrPRS(carrier,prs,Name=Value) specifies options by using one or more name-value arguments. For example, OutputDataType='single' sets the data type of the output symbols to single.

    Examples

    collapse all

    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}
    
    

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

    Figure contains an axes object. The axes object with title PRS Resource Elements, xlabel OFDM Symbols, ylabel Subcarriers contains 3 objects of type image, line. These objects represent PRS Resource 1, PRS Resource 2.

    Input Arguments

    collapse all

    Carrier configuration parameters for a specific OFDM numerology, specified as an nrCarrierConfig object. This function uses only these nrCarrierConfig 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.

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

    Data Types: char | string

    Output format of PRS symbols, specified as one of these values.

    • 'concatenated' — The output sym is a single column vector containing all PRS symbols concatenated.

    • 'cell' — The output sym is a cell array where each cell corresponds to a single PRS resource.

    Data Types: char | string

    Output Arguments

    collapse all

    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

    Version History

    Introduced in R2021a