Main Content

NR HDL MIB Recovery for FR2

This example shows how to design a 5G NR master information block (MIB) recovery model which is optimized for HDL code generation and hardware implementation, and supports both frequency range 1 (FR1) and frequency range 2 (FR2).


5G cell towers can operate in either FR1 or FR2 frequency bands. FR1 covers frequencies up to 6 GHz and FR2 covers frequencies above 6 GHz, including the millimeter wave band. This example introduces new functionality which is required to support FR2 and the process of upgrading an existing FR1 design.

The Simulink® models described in this example are fixed-point HDL-optimized implementations of MIB recovery for 5G NR FR1 and FR2. This example is one of a related set which show the workflow for designing and deploying a 5G NR cell search and MIB recovery algorithm to hardware. The complete workflow is shown.

Each step in this workflow is demonstrated by one or more related examples.

  1. MATLAB Golden Reference Algorithm: The NR Cell Search and MIB and SIB1 Recovery (5G Toolbox) example shows the floating-point golden reference algorithm.

  2. MATLAB Hardware Reference Algorithm: The NR HDL Cell Search and MIB Recovery MATLAB Reference models hardware-friendly algorithms and generates test waveforms. This MATLAB® code operates on vectors and matrices of floating-point data samples and does not support HDL code generation.

  3. Simulink Fixed-Point Implementation Model: The NR HDL Cell Search example demonstrates a 5G cell search Simulink subsystem that uses the same algorithm as the MATLAB reference. The NR HDL MIB Recovery example adds a broadcast channel decoding and MIB recovery subsystem. The NR HDL MIB Recovery for FR2 example (this example) shows cell search and MIB recovery models which have been extended to support FR2. These models operate on fixed-point data and are optimized for HDL code generation.

  4. Simulink SoC Deployment Model: The Deploy NR HDL Reference Applications on SoCs examples build on the fixed-point implementation models and use hardware support packages to deploy the algorithms on hardware.

For a general description of how MATLAB and Simulink can be used together to develop deployable models, see Wireless Communications Design for FPGAs and ASICs.

File Structure

This example uses these files.

Simulink models

  • nrhdlMIBRecovery.slx: This Simulink model combines the processing of the SSB detector and the SSB decoder into an integrated model illustrating the complete MIB recovery process. This model uses the nrhdlSSBDetectionCore.slx and nrhdlSSBDecodingCore.slx model references.

  • nrhdlSSBDecodingCore.slx: This model reference implements the SSB decoding algorithm.

  • nrhdlSSBDetectionCore.slx: This model reference implements the SSB detection algorithm.

Simulink data dictionary

  • nrhdlReceiverData.sldd: This Simulink data dictionary contains bus objects that define the buses contained in the example models.


  • runMIBRecoveryModelFR2.m: Script for running and verifying the nrhdlMIBRecovery model with an FR2 waveform.

  • nrhdlexamples: Package containing the MATLAB reference code and utility functions for verifying the implementation models.

SSB Detection

This section describes the changes to SSB detection in the NR HDL Cell Search example which are required to support FR2. It details the algorithmic requirements across the MATLAB reference and Simulink implementation, and the optimizations made for HDL code generation.

The SSB detection algorithm performs search and demodulation with a given subcarrier spacing (SCS). The SCS options are 15 kHz or 30 kHz for FR1 and 120 kHz or 240 kHz for FR2. To add FR2 functionality, the new SCS options must be supported. The detector searches for SSBs by downsampling the received signal to one of the rates shown in the table according to the SCS. The signal is then cross-correlated with the PSS sequences.

    SCS (kHz)    Sample Rate (MHz)
    _________    _________________

        15              3.84      
        30              7.68      
       120             30.72      
       240             61.44      

To accommodate the increased bandwidth of the SSBs in FR2, an input sampling rate of 122.88 Msps is used compared to 61.44 Msps for the FR1 design. The timing reference units are unchanged and are still measured in samples at 61.44 Msps. The timing reference counters increment in steps of 16, 8, 2, and 1 for SCS of 15, 30, 120, and 240 kHz respectively. This model includes a modified DDC design that supports these additional subcarrier spacings and their corresponding sample rates. The DDC corrects frequency offsets and then downsamples to 61.44 MHz. The output from the DDC is the input to the SCS selection subsystem. This subsystem creates the data streams for each SCS option by successively downsampling with halfband filters. All four streams are aligned, allowing the timing reference to be maintained when switching between different subcarrier spacings. The selected stream is correlated against each of the three PSS sequences to detect SSBs.

The FPGA implementation of these correlators in the time domain uses 576 DSPs, 4 times more than the version which only supports FR1. This change in resources is because the sampling rates reduce the amount of resource sharing which can be achieved in the filters. A frequency domain overlap-add method is used to minimize the DSP usage at the expense of an increase in latency. The overlap-add correlation in the nrhdlSSBDetectionCore model is shown. The subsystem computes the four stages of the overlap-add method. These are FFT, multiplication by the three sets of frequency domain coefficients (one for each PSS), IFFT, and overlap and add of subsequent windows. This implementation uses one FFT, three complex multipiers, and three IFFTs, requiring 48 DSPs in total.

SSB Decoding

This section describes the updates required to add FR2 support to the SSB decoding algorithm. For a complete description of the FR1 model see the NR HDL MIB Recovery example. It details the algorithmic requirements across the MATLAB reference and Simulink implementation.

The SSB Decoding algorithm decodes the broadcast channel (BCH) contained in the SSB. The decode process outputs the master information block (MIB) and the beam index of the detected SSB. In FR1, there are a maximum of 8 SSBs which can be independently beamformed. FR2 supports transmitting 64 SSBs, each on their own beam. The contents of the BCH varies between FR1 and FR2 to accommodate the different maximum beam count.

The nrhdlexamples.ssbDecode function and nrhdlSSBDecodingCore model accept Lmax as an input. Lmax is the maximum number of beams that can be transmitted by a cell tower, and depends on the carrier frequency. Valid settings for Lmax are 4 or 8 for FR1 and 64 for FR2. Lmax affects the descrambling within the BCH processing/extract payload subsystem, and how the final BCH payload is parsed.

MIB Recovery Simulation

Use the runMIBRecoveryModelFR2 script to run an FR2 MIB recovery simulation and verify the results. The script displays its progress at the MATLAB command prompt. The simulation uses the nrhdlMIBRecovery model which references the nrhdlSSBDetectionCore and nrhdlSSBDecodingCore models. The input stimulus for the simulation is an FR2 waveform containing an SS burst with these parameters.

  • SSB pattern is case D.

  • Subcarrier spacing is 120 kHz.

  • NCellID is 249.

  • Active SSBs are transmitted on SSB indices 24:31.

A plot is generated showing the resource grid of the burst waveform. The amplitude of each resource element is indicated by its color. The plot shows the eight transmitted SSBs. The SSBs are generated with different power levels to model what a UE typically receives.

The simulation searches for SSBs in the waveform using the MATLAB reference. The SSBs detected during the search, and their parameters, are shown in a table. The SSB with the strongest PSS correlation is selected for demodulation and decoding to test the nrhdlMIBRecovery model. The subcarrier spacing, PSS sequence, timing offset and frequency offset estimate are passed into the model to specify which SSB to demodulate and decode. The final results of the decoding process are shown, with both the simulation and MATLAB reference results shown for comparison.

Searching for SSBs using the MATLAB reference.
SSBs found by MATLAB reference:
    NCellID2    timingOffset    pssCorrelation    pssEnergy    frequencyOffset
    ________    ____________    ______________    _________    _______________

       0         1.0918e+05        0.42856          0.9903          51134     
       0         1.1137e+05        0.76446          1.6985          49836     
       0         1.1576e+05        0.27392         0.66928          48771     
       0         1.1795e+05          4.138          7.8159          49815     
       0         1.2456e+05        0.58574           1.249          51829     
       0         1.2675e+05         1.2834          2.7073          49390     
       0         1.3113e+05        0.18099         0.49988          48119     
       0         1.3332e+05        0.59469          1.2165          47641     

Demodulating the strongest SSBs using the MATLAB reference.
Decoding the SSB using the MATLAB reference.
Successfully decoded SSB with MATLAB reference
Demodulating the strongest SSBs using Simulink model.
Running nrhdlMIBRecovery.slx
### Starting serial model reference simulation build
### Model reference simulation target for nrhdlSSBDecodingCore is up to date.
### Model reference simulation target for nrhdlSSBDetectionCore is up to date.

Build Summary

0 of 2 models built (2 models already up to date)
Build duration: 0h 0m 3.4464s
Successfully decoded SSB with Simulink model
 MATLAB decoded information
    pbchPayload: 218103955
       ssbIndex: 27
            hrf: 0
            err: 0
            mib: [1×1 struct]

 Simulink decoded information
    pbchPayload: 218103955
       ssbIndex: 27
            hrf: 0
            err: 0
            mib: [1×1 struct]

 MATLAB decoded MIB parameters
                     NFrame: 105
    SubcarrierSpacingCommon: 120
                      k_SSB: 0
          DMRSTypeAPosition: 2
            PDCCHConfigSIB1: 0
                 CellBarred: 0
       IntraFreqReselection: 0

 Simulink decoded MIB parameters
                     NFrame: 105
    SubcarrierSpacingCommon: 120
                      k_SSB: 0
          DMRSTypeAPosition: 2
            PDCCHConfigSIB1: 0
                 CellBarred: 0
       IntraFreqReselection: 0

HDL Code Generation and Implementation Results

To generate the HDL code for this example, you must have an HDL Coder™ license. Use the makehdl and makehdltb commands to generate HDL code and an HDL test bench for nrhdlMIBRecovery/MIB Recovery subsystem. The resulting HDL code was synthesized for a Xilinx® Zynq®-7000 ZC706 evaluation board. The table shows the post place and route resource utilization results for each model reference and the combined model. The design meets timing with a clock frequency of 200 MHz.

Resource utilization breakdown by model:

       Resource        nrhdlMIBRecovery    nrhdlSSBDetectionCore    nrhdlSSBDecodingCore
    _______________    ________________    _____________________    ____________________

    Slice Registers         64317                  55969                    8302        
    Slice LUTs              43304                  32380                   11138        
    RAMB18                     40                     34                       6        
    RAMB36                     10                      5                       5        
    DSP48                     207                    170                      37        

Related Topics