Main Content

nrSSBMeasurements

SSB-based physical layer measurements

Since R2022b

    Description

    meas = nrSSBMeasurements(ssbGrid,ncellid) returns physical layer measurements for the specified synchronization signal block (SSB), ssbGrid, and physical layer cell identity number, ncellid, as defined in TS 38.215 Sections 5.1.1 and 5.1.3 [1]. The returned structure meas contains the reference signal received power (RSRP) for the SSS and the received signal strength indicator (RSSI) and reference signal received quality (RSRQ) for the SSB.

    example

    meas = nrSSBMeasurements(ssbGrid,ncellid,ibarSSB) also specifies the time-dependent part of the DM-RS scrambling initialization, ibarSSB. Use this syntax to include the physical broadcast channel demodulation reference signal (PBCH DM-RS) symbols from the ssbGrid input in the RSRP measurement.

    example

    meas = nrSSBMeasurements(___,EnablePhaseCorrection=phasecorrection) also specifies if phase correction is enabled or disabled in the SSB measurements, in addition to the input arguments in any of the previous syntaxes. (since R2025a)

    Examples

    collapse all

    Create an SSB for one receive antenna.

    ssblock = zeros(240,4);

    Set the cell identity and the corresponding PSS symbols.

    ncellid = 17;
    pssSymbols = nrPSS(ncellid);
    ssblock(nrPSSIndices) = pssSymbols;

    Generate the SSS symbols.

    sssSymbols = nrSSS(ncellid);
    ssblock(nrSSSIndices) = sssSymbols;

    Generate the PBCH modulation symbols by using a random codeword, the cell identity, and a scrambling sequence phase of 0.

    cw = randi([0 1],864,1);
    v = 0;
    pbchSymbols = nrPBCH(cw,ncellid,v);
    pbchIndices = nrPBCHIndices(ncellid);
    ssblock(pbchIndices) = pbchSymbols;

    Generate the PBCH DM-RS symbols by using the cell identity and the time-dependent part of the DM-RS scrambling initialization.

    ibarSSB = 0;
    dmrsSymbols = nrPBCHDMRS(ncellid,ibarSSB);
    dmrsIndices = nrPBCHDMRSIndices(ncellid);
    ssblock(dmrsIndices) = dmrsSymbols;

    OFDM-modulate the SS block.

    scs = 15;
    initialNSlot = 0;
    txWaveform = nrOFDMModulate(ssblock,scs,initialNSlot);

    Pass the time-domain waveform through an AWGN channel with a signal-to-noise ratio of 10 dB.

    snr = 10;
    rxWaveform = awgn(txWaveform,snr,"measured");

    Demodulate the received waveform to obtain the SSB.

    nrb = 20;
    ssbGrid = nrOFDMDemodulate(rxWaveform,nrb,scs,initialNSlot);

    Obtain the RSRP, RSSI, and RSRQ measurements based on the SSB.

    meas1 = nrSSBMeasurements(ssbGrid,ncellid)
    meas1 = struct with fields:
        RSRPPerAntenna: 29.8709
        RSSIPerAntenna: 53.3522
        RSRQPerAntenna: -10.4710
    
    

    For comparison, call the nrSSBMeasurements function again by including the PBCH DM-RS symbols in the RSRP measurement.

    meas2 = nrSSBMeasurements(ssbGrid,ncellid,ibarSSB)
    meas2 = struct with fields:
        RSRPPerAntenna: 29.9400
        RSSIPerAntenna: 53.3522
        RSRQPerAntenna: -10.4019
    
    

    Input Arguments

    collapse all

    SSB grid, specified as a complex-valued array of size 240-by-4-by-R, where R is the number of receive antennas. ssbGrid specifies a single SSB.

    Data Types: single | double
    Complex Number Support: Yes

    Physical layer cell identity number, specified as an integer from 0 to 1007.

    Data Types: double

    Time-dependent part of the DM-RS scrambling initialization, specified as an integer from 0 to 7. Specify this input based on the least significant bits (LSBs) of the SS/PBCH block index and the half-frame number from the SS burst configuration.

    • If the number of SS/PBCH blocks per half-frame is 4, ibarSSB = iSSB + 4 × nhf, where iSSB is the two LSBs of the SS/PBCH block index (0 to 3). nhf is the half-frame number within the frame (0,1).

    • If the number of SS/PBCH blocks per half-frame is 8 or 64, ibarSSB is the three LSBs of the SS/PBCH block index (0 to 7).

    Data Types: double

    Enable phase correction, specified as one of these logical values:

    • 0 (false) — Disable phase correction.

    • 1 (true) — Enable phase correction. When you enable phase correction, the function handles timing offsets due to synchronization errors and frequency selective channels in the received waveform.

    Data Types: logical | double
    Complex Number Support: Yes

    Output Arguments

    collapse all

    SSB-based physical layer measurements, returned as a structure containing these fields.

    FieldValueDescription
    RSRPPerAntennaReal-valued column vectorVector of RSRP values in dBm relative to 1 milliwatt in 1 ohm
    RSSIPerAntennaReal-valued column vector

    Vector of RSSI values in dBm relative to 1 milliwatt in 1 ohm

    RSRQPerAntenna Real-valued column vector

    Vector of RSRQ values in dB

    The rows of these column vectors correspond to receive antennas.

    Data Types: struct

    References

    [1] 3GPP TS 38.215. “NR; Physical layer measurements.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    Extended Capabilities

    expand all

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2022b

    expand all