Main Content

nrUE

R2026b

5G NR user equipment (UE) node

Since R2023a

    Description

    Use the nrUE object to create and configure new radio (NR) user equipment (UE) nodes. This feature also requires the Wireless Network Toolbox™ product (since R2026a).

    Creation

    Description

    ue = nrUE creates a default UE object.

    example

    ue = nrUE(PropertyName=Value) creates one or more similar UE objects, and sets writable properties using one or more optional name-value arguments. For example, Position=[100 100 0; 5000 100 0],Name=["ue1","ue2"] creates two UE objects, one with the name "ue1" and the other named "ue2", positioned at [100 100 0] and [5000 100 0], respectively. The number of rows in the Position argument defines the number of UE objects created. If you create N nodes but supply M names, where M is greater than N, the nrUE object uses only the first N names. If M is less than N, the object uses default names for the trailing (N-M) nodes.

    example

    Properties

    expand all

    Name of the UE node, specified as a character vector, string scalar, string array, or cell array of character vectors.

    If you do not set the Name property, the nrGNB object sets a default name, NodeX, where X is the ID of the node.

    To set the value of this property for multiple UE nodes simultaneously, you must specify it at object creation.

    Note

    Starting in R2026a, you can set this property only at object creation. After creation, the property is read-only. In releases R2025b and before, after creating the object, you can set the value of this property for one node object at a time.

    Data Types: char | string

    Node position in 3-D Cartesian coordinates, specified as a three-element numeric row vector or N-by-3 matrix. N is the number of nrUE objects to create using the creation function. Each row specifies the position of the node in Cartesian x-, y-, and z- coordinates. Units are in meters.

    To set the value of this property for multiple UE nodes simultaneously, you must specify it at object creation. After object creation, you can set the value of this property for one UE object at a time.

    Data Types: double

    This property is read-only after object creation.

    Noise figure, specified as a nonnegative finite scalar. The object uses this value to apply thermal noise on the received packet. Units are in dB.

    Data Types: double

    This property is read-only after object creation.

    Receiver antenna gain, specified as a nonnegative finite scalar. Units are in dB.

    Data Types: double

    This property is read-only after object creation.

    Number of transmit antennas, specified as 1, 2, or 4.

    Data Types: double

    This property is read-only after object creation.

    Number of receive antennas, specified as 1, 2, or 4.

    Data Types: double

    This property is read-only after object creation.

    Peak transmit power of a UE node, specified as a finite numeric scalar. Units are in dBm. This value defines the maximum power the UE node can transmit on the allocated PRBs and reflects the actual power measured without any measurement error, according to section 3 of 3GPP TR 21.905. You can set this value up to 60 dBm. Use the configureULPowerControl object function of nrGNB to set uplink power control parameters. The UE performs the actual power computation, which can be less than or equal to the maximum transmit power.

    By default, a gNB node activates the uplink transmit power control mechanism for the connected UE nodes. To configure the uplink (UL) power control mechanism, use the configureULPowerControl function of the nrGNB object. In this mode, a UE node determines its actual transmit power, which is less than or equal to the specified value of TransmitPower, based on the uplink power control equation specified in TS 38.213, Section 7.1 [5].

    To disable the UL power control mechanism, set the value of PoPUSCH to a value greater than the value of TransmitPower. When disabled, the actual transmit power of a UE node is the specified value of TransmitPower.

    When you enable carrier aggregation (NumComponentCarriers is greater than 1), the UE node calculates transmit power proportionally across connected and activated carriers based on their bandwidth. To distribute the power, it performs these steps.

    • Sums the bandwidth of all carriers (Total BW)

    • Computes the normalization factor as

      normi=BWiBWtotal.

      In this equation,

      • normi — Normalization factor for the ith carrier

      • BWi — Bandwidth of ith carrier

      • BWtotal — Total aggregated bandwidth

    • Computes Transmit power allocated to a carrier as Pcarrier,i=Pmax+10log10(normi)

      In this equation,

      • Pcarrier,i — Transmit power allocated to the ith carrier

      • Pmax — TransmitPower property value of the UE node (in dBm).

    Data Types: double

    Since R2026b

    This property is read-only after object creation.

    Transmit antenna array characteristics, specified as a structure or a phased.NRRectangularPanelArray (Phased Array System Toolbox) object (requires Phased Array System Toolbox™).

    When specified as a structure, this property contains the fields listed in this table.

    Parameter FieldValuesDescription
    Size

    [1 1 1 1 1] (default)

    row vector

    The configuration must match one of these:

    • For 1 antenna: [1 1 1 1 1]

    • For 2 antennas: [1 1 2 1 1]

    • For 4 antennas: [2 1 2 1 1]

    Size of antenna array, specified as [M N P Mg Ng], where:

    • M and N are the number of rows and columns in the antenna array, respectively.

    • P is the number of polarizations (1 or 2).

    • Mg and Ng are the number of row and column array panels, respectively.

    The overall antenna array consists of Mg-by- Ng antenna panels, where each antenna panel is of size M-by-N. If P = 1, all antenna array elements have the same polarization angle. If P = 2, half of the antenna array elements have one polarization angle and the other half have another polarization angle.

    ElementSpacing

    [] (default)

    row vector

    Element spacing, in wavelengths, specified as a row vector of the form [λv λh dgv dgh]. The vector elements represent the vertical and horizontal element spacing and the vertical and horizontal panel spacing, respectively. The panel spacing is measured from the center of the panels.

    PolarizationAngles

    [] (default)

    row vector

    Polarization angles in degrees, specified as a row vector of the form [θ ρ].

    Element

    "isotropic" (default)

    "38.901"

    Antenna element radiation pattern as described in TR 38.901 Section 7.3 and TR 38.811. (Note that TR 38.901 supersedes TR 38.900.)

    PolarizationModel

    "Model-2"(default)

    "Model-1"

    Model that determines the radiation field patterns based on a defined radiation power pattern. For more information about the defined radiation power pattern, see TR 38.901 Section 7.3.2.

    Since R2026b

    This property is read-only after object creation.

    Mechanical orientation of the transmit antenna array, specified as a three-element numeric column vector of the form [α; β; γ]. The vector elements specify the bearing, downtilt, and slant rotation angles in degrees, respectively, as specified in TR 38.901 Section 7.1.3. For more information on how the object applies these rotation angles, see Mechanical Orientation of Antenna Arrays.

    The default array orientation, corresponding to the value [0; 0; 0], depends on the TransmitAntennaArray property.

    • If you specify the TransmitAntennaArray property as a structure (default), in the default array orientation, the broadside direction points to the positive x-axis.

    • If you specify the TransmitAntennaArray property as a phased.NRRectangularPanelArray (Phased Array System Toolbox) array (requires Phased Array System Toolbox), you can configure the default array orientation by setting the relevant array properties of the specified phased array object.

    Data Types: double

    Since R2026b

    This property is read-only after object creation.

    Receive antenna array configuration, specified as a structure or a phased.NRRectangularPanelArray (Phased Array System Toolbox) object (requires Phased Array System Toolbox).

    When specified as a structure, this property contains the fields listed in this table.

    Parameter FieldValuesDescription
    Size

    [1 1 1 1 1] (default)

    row vector

    The configuration must match one of these:

    • For 1 antenna: [1 1 1 1 1]

    • For 2 antennas: [1 1 2 1 1]

    • For 4 antennas: [2 1 2 1 1]

    Size of antenna array, specified as [M N P Mg Ng], where:

    • M and N are the number of rows and columns in the antenna array, respectively.

    • P is the number of polarizations (1 or 2).

    • Mg and Ng are the number of row and column array panels, respectively.

    The overall antenna array consists of Mg-by- Ng antenna panels, where each antenna panel is of size M-by-N. If P = 1, all antenna array elements have the same polarization angle. If P = 2, half of the antenna array elements have one polarization angle and the other half have another polarization angle.

    ElementSpacing

    [] (default)

    row vector

    Element spacing, in wavelengths, specified as a row vector of the form [λv λh dgv dgh]. The vector elements represent the vertical and horizontal element spacing and the vertical and horizontal panel spacing, respectively. The panel spacing is measured from the center of the panels.

    PolarizationAngles

    [] (default)

    row vector

    Polarization angles in degrees, specified as a row vector of the form [θ ρ].

    Element

    "isotropic" (default)

    "38.901"

    Antenna element radiation pattern as described in TR 38.901 Section 7.3 and TR 38.811. (Note that TR 38.901 supersedes TR 38.900.)

    PolarizationModel

    "Model-2"(default)

    "Model-1"

    Model that determines the radiation field patterns based on a defined radiation power pattern. For more information about the defined radiation power pattern, see TR 38.901 Section 7.3.2.

    Since R2026b

    This property is read-only after object creation.

    Mechanical orientation of the receive antenna array, specified as a three-element numeric column vector of the form [α; β; γ]. The vector elements specify the bearing, downtilt, and slant rotation angles in degrees, respectively, as specified in TR 38.901 Section 7.1.3. For more information on how the object applies these rotation angles, see Mechanical Orientation of Antenna Arrays.

    The default array orientation, corresponding to the value [0; 0; 0], depends on the ReceiveAntennaArray property.

    • If you specify the ReceiveAntennaArray property as a structure (default), in the default array orientation, the broadside direction points to the positive x-axis.

    • If you specify the ReceiveAntennaArray property as a phased.NRRectangularPanelArray (Phased Array System Toolbox) array (requires Phased Array System Toolbox), you can configure the default array orientation by setting the relevant array properties of the specified phased array object.

    Data Types: double

    Since R2026b

    This property is read-only after object creation.

    Antenna efficiency losses, specified as a structure with these fields:

    • "Tx" — Transmit antenna efficiency loss in dB. The default value is 0.

    • "Rx" — Receive antenna efficiency loss in dB. The default value is 0.

    Data Types: double

    Since R2026b

    This property is read-only after object creation.

    receiver algorithm, specified as one of these values:

    • "mmse" — Minimum Mean square error (MMSE) receiver that minimizes mean square error between transmitted and received signals.

    • "mmse-irc" — MMSE receiver with interference rejection combining.

    Since R2026a

    This property is read-only.

    This property is read-only after object creation.

    Physical (PHY) layer model, specified as one of these options. Note that all the 5G base station (gNB) and UE nodes must use the same PHY model.

    • "abstract-phy" — Enable the link-to-system mapping-based abstracted PHY. The abstracted PHY models the link quality and performance to calculate the packet error rate (PER). Unlike full PHY, it does not involve waveform generation and decoding. For more information about the abstracted PHY, see Composition of NR Nodes.

    • "full-phy" — Enable full PHY processing. Full PHY processing involves waveform generation and decoding at the PHY layer.

    Data Types: char | string

    Since R2026b

    This property is read-only after object creation.

    Maximum numbers of carriers on which a UE node can connect to a gNB node, specified as an integer in the range [1,16].

    Data Types: double

    Since R2026a

    Node mobility model, represented as an object of a subclass of the wnet.Mobility class. The value of the Mobility property indicates the type of mobility object associated with the node, which you add using the addMobility function.

    Note

    This property value remains empty until you add a mobility model using the addMobility function.

    This property is read-only.

    Node identifier of the UE node, represented as a positive integer. This value specifies a unique identifier for a node in the simulation.

    Note

    If you create and store the UE nodes in an uninitialized matrix, the node IDs that this property allocates to the nodes can be non-sequential because of the memory allocation to the object in the matrix. For more information about memory allocation, see How MATLAB Allocates Memory.

    Data Types: double

    This property is read-only.

    Connection state of the UE node, represented as "Idle" or "Connected", where"Idle" indicates that no connection between the UE and gNB nodes exists.

    Note

    This property is only visible when NumComponentCarriers equals one. The nrUE object initializes this property to "Idle" during object creation and updates it to "Connected" when you connect the UE node to a gNB node using theconnectUE method.

    Data Types: char | string

    Since R2026b

    This property is read-only.

    Status of secondary carriers for the UE node, represented as a string vector, where each element is either "Inactive" or "Active". "Inactive" indicates that the secondary carrier is not active for the UE, while "Active" indicates that the secondary carrier is active for the UE.

    Note

    The property is only visible when NumComponentCarriers is greater than one. The nrUE object initializes this property with "Inactive" values during object creation. The vector size is (NumComponentCarriers - 1), as it excludes the primary carrier. Individual elements update to "Active" when you add and activate secondary carriers using the addSecondaryCarrierOnUE function (first element for the first secondary carrier, second element for the second secondary carrier, and so on).

    Since R2026b

    This property is read-only.

    Node identifier of the gNB node to which the UE node connects, represented as a positive integer.

    Note

    The nrUE object populates this property automatically when you connect the UE node to a gNB node using the connectUE function. This property is visible only after connection establishment.

    Data Types: double

    Since R2026b

    This property is read-only.

    Name of the gNB node to which the UE connects, represented as a string scalar.

    Note

    The nrUE object populates this property automatically when you connect the UE node to a gNB node using the connectUE function. This property is visible only after connection establishment.

    Data Types: string

    This property is read-only.

    Radio network temporary identifier of the UE, represented as an integer in the range [1, 65,519].

    Note

    The nrUE object populates this property automatically when you connect the UE node to a gNB node using the connectUE function. This property is visible only after connection establishment.

    Data Types: double

    Since R2026a

    This property is read-only.

    Node velocity in 3-D Cartesian coordinates, represented as a three-element numeric row vector. The units are in meters per second. The value of the Velocity property represents the current velocity at which the node is moving.

    Data Types: double

    Object Functions

    addTrafficSourceAdd data traffic source to 5G NR node
    registerEventCallbackRegister callback for event from 5G node
    statisticsStatistics of UE
    addMobilityAdd mobility model to UE node

    Examples

    collapse all

    Create 10 similar UE nodes with each having a transmit power of 20 dBm. Place the UE nodes randomly along the X-axis within 1000 meters of the origin.

    numUEs = 10;                                           % Number of UEs
    position = [1000*rand(numUEs,1) zeros(numUEs,2)];    % In Cartesian x, y, and z coordinates
    ue1 = nrUE(Position=position,TransmitPower=20);
    display(ue1(1))
      nrUE with properties:
    
                        Position: [814.7237 0 0]
                            Name: "Node3"
                        Mobility: []
    
       Read-only properties:
                     NoiseFigure: 6
                     ReceiveGain: 0
                   TransmitPower: 20
             NumTransmitAntennas: 1
              NumReceiveAntennas: 1
                        PHYModel: "abstract-phy"
            NumComponentCarriers: 1
            TransmitAntennaArray: [1×1 struct]
             ReceiveAntennaArray: [1×1 struct]
        TransmitArrayOrientation: [3×1 double]
         ReceiveArrayOrientation: [3×1 double]
               AntennaEfficiency: [1×1 struct]
                    ReceiverType: "mmse-irc"
                 ConnectionState: "Idle"
                              ID: 3
                        Velocity: [0 0 0]
    
    display(ue1(7))
      nrUE with properties:
    
                        Position: [278.4982 0 0]
                            Name: "Node9"
                        Mobility: []
    
       Read-only properties:
                     NoiseFigure: 6
                     ReceiveGain: 0
                   TransmitPower: 20
             NumTransmitAntennas: 1
              NumReceiveAntennas: 1
                        PHYModel: "abstract-phy"
            NumComponentCarriers: 1
            TransmitAntennaArray: [1×1 struct]
             ReceiveAntennaArray: [1×1 struct]
        TransmitArrayOrientation: [3×1 double]
         ReceiveArrayOrientation: [3×1 double]
               AntennaEfficiency: [1×1 struct]
                    ReceiverType: "mmse-irc"
                 ConnectionState: "Idle"
                              ID: 9
                        Velocity: [0 0 0]
    

    Create 7 similar UE nodes with each having a transmit power of 29 dBm transmit power. Place the UE nodes randomly.

    numUEs = 7;                                              % Number of UEs
    position = [700*rand(numUEs,1) 500*rand(numUEs,2)];    % In Cartesian x, y, and z coordinates
    ue2 = nrUE(Position=position,TransmitPower=29);

    Create a default gNB node.

    gnb = nrGNB
    gnb = 
      nrGNB with properties:
    
                        Position: [0 0 0]
                            Name: "Node1"
                        Mobility: []
    
       Read-only properties:
                     NoiseFigure: 6
                     ReceiveGain: 6
                   TransmitPower: 34
             NumTransmitAntennas: 1
              NumReceiveAntennas: 1
                        PHYModel: "abstract-phy"
                      DuplexMode: "FDD"
                CarrierFrequency: [2.6725e+09 2.5275e+09]
                ChannelBandwidth: 5000000
               SubcarrierSpacing: 15000
               NumResourceBlocks: 25
                         NumHARQ: 16
        ULPowerControlParameters: [1×1 struct]
                SRSPeriodicityUE: 5
          SRSMeasurementConfigDL: [1×1 struct]
          ComponentCarrierConfig: [1×1 nrComponentCarrierConfig]
            TransmitAntennaArray: [1×1 struct]
             ReceiveAntennaArray: [1×1 struct]
        TransmitArrayOrientation: [3×1 double]
         ReceiveArrayOrientation: [3×1 double]
               AntennaEfficiency: [1×1 struct]
                    ReceiverType: "mmse-irc"
                              ID: 1
                        Velocity: [0 0 0]
    
       Constant properties:
                        MCSTable: [28×4 table]
    
    

    Create a default UE node.

    ue = nrUE
    ue = 
      nrUE with properties:
    
                        Position: [0 0 0]
                            Name: "Node2"
                        Mobility: []
    
       Read-only properties:
                     NoiseFigure: 6
                     ReceiveGain: 0
                   TransmitPower: 23
             NumTransmitAntennas: 1
              NumReceiveAntennas: 1
                        PHYModel: "abstract-phy"
            NumComponentCarriers: 1
            TransmitAntennaArray: [1×1 struct]
             ReceiveAntennaArray: [1×1 struct]
        TransmitArrayOrientation: [3×1 double]
         ReceiveArrayOrientation: [3×1 double]
               AntennaEfficiency: [1×1 struct]
                    ReceiverType: "mmse-irc"
                 ConnectionState: "Idle"
                              ID: 2
                        Velocity: [0 0 0]
    
    

    Establish a connection between the UE node and the gNB node.

    connectUE(gnb,ue)

    Initialize wireless network simulator.

    networkSimulator = wirelessNetworkSimulator.init;

    Create a gNB node with these specifications.

    • Duplex mode — Time division duplex

    • Channel bandwidth — 20 MHz

    • Subcarrier spacing — 30 KHz

    gnb = nrGNB(ChannelBandwidth=20e6,DuplexMode="TDD",SubcarrierSpacing=30e3);

    Create a UE node with a transmit power of 20 dBm.

    ue = nrUE(TransmitPower=20);

    Add a random way point mobility model to the UE node.

    addMobility(ue,BoundaryShape="rectangle")

    Establish a connection between the UE and gNB nodes.

    connectUE(gnb,ue)

    Create a voice over Internet protocol (VoIP) application traffic pattern object.

    traffic = networkTrafficVoIP;

    Add the data traffic source to the gNB node. Set the destination node as the UE node.

    addTrafficSource(gnb,traffic,DestinationNode=ue)

    Add the gNB node to the wireless network simulator.

    addNodes(networkSimulator,gnb)

    Add the UE node to the wireless network simulator.

    addNodes(networkSimulator,ue)

    Specify the simulation time, in seconds.

    simulationTime = 0.3;

    Run the simulation for the specified simulation time.

    run(networkSimulator,simulationTime)

    Obtain the statistics for the gNB and UE nodes.

    gnbStats = statistics(gnb);
    ueStats = statistics(ue);

    Carrier aggregation enables the gNB and UE nodes to transmit and receive data simultaneously on multiple carriers, significantly increasing data throughput. In a 5G network, the base stations manage and allocate these carriers to the UE nodes. This example demonstrates how to configure and simulate carrier aggregation in a 5G network.

    In this example, you create:

    • One gNB node with two component carriers

    • Two UE nodes. The first UE node connects to the primary carrier only (single carrier operation), while the second UE node connects to both the primary and secondary carriers (carrier aggregation).

    To simulate the scenario, follow these steps.

    Create the network simulator.

    rng("default") % Reset the random number generator
    networkSimulator = wirelessNetworkSimulator.init
    networkSimulator = 
      wirelessNetworkSimulator with properties:
    
            CurrentTime: 0
                EndTime: 0
        ChannelFunction: "fspl"
                  Nodes: {}
    
    

    Create component carrier configurations using the nrComponentCarrierConfig object.

    % Two NR carriers in the same band
    ccConfigs = nrComponentCarrierConfig(NumContiguousCarriers=2)
    ccConfigs = 
      1×2 nrComponentCarrierConfig array
    
    

    The array contains two contiguous component carrier objects: the first corresponds to the primary carrier, and the second corresponds to the secondary carrier.

    Display the component carrier objects.

    ccConfigsPrimary = ccConfigs(1)
    ccConfigsPrimary = 
      nrComponentCarrierConfig with properties:
    
       Read-only properties:
         CarrierFrequency: [2.6725e+09 2.5275e+09]
         ChannelBandwidth: 5000000
        NumResourceBlocks: 25
        SubcarrierSpacing: 15000
               DuplexMode: "FDD"
         SRSPeriodicityUE: 5
    
    
    ccConfigsSecondary=ccConfigs(2)
    ccConfigsSecondary = 
      nrComponentCarrierConfig with properties:
    
       Read-only properties:
         CarrierFrequency: [2.6775e+09 2.5325e+09]
         ChannelBandwidth: 5000000
        NumResourceBlocks: 25
        SubcarrierSpacing: 15000
               DuplexMode: "FDD"
         SRSPeriodicityUE: 5
    
    

    Create a gNB node with multiple component carriers.

    gNB = nrGNB(ComponentCarrierConfig=ccConfigs, ...
        NumTransmitAntennas=4, ...
        NumReceiveAntennas=4);

    Configure a built-in scheduler for multiple carriers.

    configureScheduler(gNB,Scheduler="BestCQI");

    Create UE nodes with multi-carrier capability.

    ue1 = nrUE(NumTransmitAntennas=2,NumReceiveAntennas=2);
    
    ue2 = nrUE(NumComponentCarriers=2, ...  % UE can connect to two carriers
        NumTransmitAntennas=2, ...
        NumReceiveAntennas=2);
    
    ues = [ue1,ue2];

    Connect the UE nodes on the primary carrier and enable full-buffer traffic. Full-buffer traffic assumes an unlimited amount of queued data is available for transmission.

    connectUE(gNB,ues,FullBufferTraffic="on"); 

    Add the secondary carrier on the second UE node.

    addSecondaryCarrierOnUE(gNB,ue2,ccConfigs(2));

    Add the nodes to the simulator.

    addNodes(networkSimulator,gNB)
    addNodes(networkSimulator,ues)

    Run the simulation.

    simulationTime = 0.1; % Units are in seconds
    run(networkSimulator,simulationTime);

    Obtain the UE node statistics.

    ue1Stats = ue1.statistics();
    ue2Stats = ue2.statistics();

    Obtain the physical layer statistics of the first UE node.

    ue1StatsPHY = ue1Stats.PHY
    ue1StatsPHY = struct with fields:
        TransmittedPackets: 97
           ReceivedPackets: 96
            DecodeFailures: 0
    
    

    Obtain the physical layer statistics of the second UE node.

    ue2StatsPHY = ue2Stats.PHY
    ue2StatsPHY = struct with fields:
        TransmittedPackets: 194
           ReceivedPackets: 192
            DecodeFailures: 0
    
    

    The results show that the second UE node, which supports carrier aggregation, achieved twice the packet transmission and reception capacity of the first UE node, which uses only the primary carrier.

    References

    [1] 3GPP TS 38.101-1. “NR; User Equipment (UE) radio transmission and reception; Part 1: Range 1 Standalone.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    [2] 3GPP TS 38.214. “NR; Physical layer procedures for data.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    [3] 3GPP TS 38.321. “NR; Medium Access Control (MAC) protocol specification.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    [4] 3GPP TS 38.322. “NR; Radio Link Control (RLC) protocol specification.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    [5] 3GPP TS 38.213. “NR; Physical layer procedures for control.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    Version History

    Introduced in R2023a

    expand all