nrGNB
R2026bDescription
Use the nrGNB object to create and configure 5G new radio (NR)
base station (gNB) nodes. This feature also requires the
Wireless Network
Toolbox™ product (since R2026a).
Creation
Description
creates a default gNB
object.gnb = nrGNB
gnb = nrGNB( creates one
or more similar gNB objects, and sets writable PropertyName=Value)properties using one
or more optional name-value arguments. For example, Position=[100 100 0; 5000 100
0],Name=["gNB1","gNB2"] creates two gNB objects, one with the name
"gNB1" and the other named "gNB2", positioned at
[100 100 0] and [5000 100 0], respectively. The
number of rows in the Position argument defines the number of gNB
objects created. If you create N nodes but supply M
names, where M is greater than N, the
nrGNB object uses only the first N names. If
M is less than N, the object uses default names
for the trailing (N-M) nodes.
Note
When you configure multiple carriers for carrier aggregation using the ComponentCarrierConfig property, the DuplexMode, CarrierFrequency, ChannelBandwidth, SubcarrierSpacing, NumResourceBlocks, DLULConfigTDD, and SRSPeriodicityUE properties of the nrGNB object do not
apply. These parameters are carrier-specific, and you must configure them within the
nrComponentCarrierConfig object(s).
Properties
Name of the gNB node, specified as a character vector, string scalar, vector of 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 gNB 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 nrGNB 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 gNB nodes simultaneously, you must specify it at object creation. After object creation, you can set the value of this property for one gNB object at a time.
Data Types: double
This property is read-only after object creation.
Noise figure, specified as a nonnegative finite scalar. 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 one of these options.
12481632
Data Types: double
This property is read-only after object creation.
Number of receive antennas, specified as one of these options.
12481632
Data Types: double
This property is read-only after object creation.
Peak transmit power of a gNB node, specified as a finite numeric scalar. Units are
in dBm. This value represents the maximum power output delivered to a load with unit
impedance, measured when the transmission uses all resource blocks. It defines the
maximum total output power of the gNB, as specified in section 3 of 3GPP TR 21.905. The
maximum transmit power you can specify is 60 dBm.
The gNB node calculates transmit power proportionally across 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
.
In this equation,
— Normalization factor for the ith carrier
— Bandwidth of ith carrier
— Total aggregated bandwidth
Computes transmit power allocated to a carrier as
In this equation,
— Transmit power allocated to the ith carrier
—
TransmitPowerproperty value of the gNB node (in dBm).
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 Field | Values | Description |
|---|---|---|
Size |
row vector The configuration must match one of these:
| Size of antenna array, specified as [M N P Mg Ng], where:
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 |
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 |
row vector | Polarization angles in degrees, specified as a row vector of the form [θ ρ]. |
Element |
| 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.) When you set |
PolarizationModel |
| 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
TransmitAntennaArrayproperty as a structure (default), in the default array orientation, the broadside direction points to the positive x-axis.If you specify the
TransmitAntennaArrayproperty as aphased.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 Field | Values | Description |
|---|---|---|
Size |
row vector The configuration must match one of these:
| Size of antenna array, specified as [M N P Mg Ng], where:
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 |
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 |
row vector | Polarization angles in degrees, specified as a row vector of the form [θ ρ]. |
Element |
| 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.) When you set |
PolarizationModel |
| 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
ReceiveAntennaArrayproperty as a structure (default), in the default array orientation, the broadside direction points to the positive x-axis.If you specify the
ReceiveAntennaArrayproperty as aphased.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 is0."Rx"— Receive antenna efficiency loss in dB. The default value is0.
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 after object creation.
Physical (PHY) layer model, specified as one of these options. Note that all the gNB and user equipment (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
This property is read-only after object creation.
Duplexing mode, specified as one of these options.
"FDD"— Frequency division duplex"TDD"— Time division duplex
Data Types: char | string
This property is read-only after object creation.
Carrier frequency, specified as one of these options. Units are in Hz.
For FDD mode, specify carrier frequency as a two-element vector in the format [DLFrequency ULFrequency], where the first element represents the downlink carrier frequency and the second element represents the uplink carrier frequency, both in Hz. For example:
CarrierFrequency = [2.68e9 2.56e9]..For TDD mode, you can specify carrier frequency as a real scalar. Both DL and UL use the same carrier frequency.
Note
Starting in R2026b, for FDD mode, you must specify the
CarrierFrequencyproperty as a two-element vector. In R2026a and earlier releases, the value of theCarrierFrequencyproperty can only be a scalar. When specified as a scalar, the gNB node automatically calculates separate DL and UL carrier frequencies based on the guard band and channel bandwidth.To model interfering gNB nodes in your simulation, the interfering gNB nodes must have the same values for the properties
CarrierFrequencyandChannelBandwidth. Additionally,SubcarrierSpacingmust be same for the interfering gNB nodes.
Data Types: double
This property is read-only after object creation.
Channel bandwidth, specified as one of these options. Units are in Hz.
5e610e615e620e630e635e640e645e650e660e670e680e690e6100e6200e6400e6
In FDD mode, the downlink (DL) and uplink (UL) operations occur in separate bands of the specified size. In TDD mode, both DL and UL share a single band of the specified size.
Note
To model interfering gNB nodes in your simulation, the interfering gNB nodes must
have the same values for the properties CarrierFrequency and ChannelBandwidth. Additionally, SubcarrierSpacing must be same for the interfering gNB nodes.
Data Types: double
This property is read-only after object creation.
Subcarrier spacing used across the cell, specified as one of these options. You may enter the value in Hz (such as 15e3) or in kHz (such as 15):
15e3or1530e3or3060e3or60120e3or120
Note
To model interfering gNB nodes in your simulation, the interfering gNB nodes must
have the same values for the properties CarrierFrequency and ChannelBandwidth. Additionally, SubcarrierSpacing must be same for the interfering gNB nodes.
Data Types: double
This property is read-only after object creation.
Number of resource blocks in the channel bandwidth, specified as an integer in the
range [4,273].
In the FDD mode, the DL bandwidth and UL bandwidth each contain resource blocks
equal to NumResourceBlocks. In the TDD mode, the DL and UL bandwidths
share these resource blocks. If you do not specify this name-value argument, then the
nrgNB object derives it automatically from the channel bandwidth
and the subcarrier spacing. The default value, 25, corresponds to the
default 5e6 Hz channel bandwidth and 15e3 Hz SCS.
The minimum value, 4, is the minimum required transmission bandwidth for a sounding
reference signal (SRS), as defined in TS 38.211, table 6.4.1.4.3-1 [3].
Data Types: double
This property is read-only after object creation.
DL and uplink (UL) time division configuration for TDD mode, specified as a structure. The structure contains these fields.
DLULPeriodicity— DL-UL pattern periodicity in milliseconds. If you specify SCS as15e3,30e3,60e3, or120e3, then the default value of theDLULPeriodicityfield is5milliseconds,2.5milliseconds,1.25milliseconds, or0.625milliseconds, respectively.NumDLSlots— Number of full DL slots at the start of the DL-UL pattern. The default value is2.NumDLSymbols— Number of DL symbols after the full DL slots. The default value is12.NumULSymbols— Number of full UL symbols at the end of the DL-UL pattern. The default value is1.NumULSlots— Number of UL slots before the full UL slots. The default value is2.
The nrGNB object sets the reference SCS for the DL-UL pattern
to the value of SubcarrierSpacing. The configuration supports one S slot after the full DL
slots and before the full UL slots. The S slot consists of
NumDLSymbols at the start and NumULSymbols
at the end. The object sets the guard period between DL and UL time to 14 -
(NumDLSymbols + NumULSymbols). You can set NumULSymbols
to 0 or 1. If you set
NumULSymbols to 1, the gNB reserves the UL
symbol for sounding reference signal (SRS).
This property corresponds to the tdd-UL-DL-ConfigurationCommon parameter, as described in Section 11.1 of TS 38.213.
Dependencies
To enable this property, set the DuplexMode
property to "TDD".
Since R2025a
This property is read-only after object creation.
Sounding reference signal (SRS) transmission periodicity of a UE node, specified as
5, 8, 10,
16, 20, 32,
40, 64, 80,
160, 320, 640,
1280, or 2560 slots. This value is identical for
all connected UE nodes. This periodicity must also be an integer multiple of
L, where L is the interval in slots at which the
gNB reserves one symbol for the SRS resource across the entire bandwidth. The minimum
value of L is 5. For FDD, the nrGNB object fixes the
value of L at 5. For TDD, L is the minimum of
these values: 5, 8, 10, 16, 20, 32, 40, 64, 80, 160, 320, 640, 1280, or 2560 slots; the
value of L is also a multiple of the DL-UL pattern length.
Data Types: double
Since R2026a
This property is read-only after object creation.
SRS-based downlink channel measurement configuration, specified as a structure with these fields:
PrecoderFormat— Precoder calculation mode, specified as"wideband"or"subband". The default value for this field is"wideband".MCSFormat— Modulation and coding scheme (MCS) calculation mode, specified as"wideband"or"subband". To enable"subband", setPrecoderFormatto"subband". When specified as"subband", the object calculates both subband and wideband MCS values. The default value for this field is"wideband".SubbandSize— Subband size for precoder and MCS calculations, specified as2or4. The default value is 4. This field is applicable when you setPrecoderFormatto"subband".
Note
Enabling the
SRSMeasurementConfigDLproperty of thenrGNBobject sets the default value of theCSIMeasurementSignalDLargument of theconfigureSchedulerfunction to"SRS".When you enable
SRSMeasurementConfigDL, the gNB node must use the same number of transmit and receive antennas.
Dependencies
To enable this property, set the DuplexMode
property to "TDD".
This property is read-only after object creation.
Number of hybrid automatic repeat request (HARQ) processes used for each UE in the DL and UL directions, specified as an integer in the range [1, 32].
Data Types: double
Since R2026b
This property is read-only after object creation.
Component carrier configuration, specified as one of these options.
Single
nrComponentCarrierConfigobject — The gNB node operates with one carrier.Vector of
nrComponentCarrierConfigobjects — The gNB node uses carrier aggregation with multiple carriers. Each element corresponds to one component carrier, where the first element is the primary carrier and subsequent elements are secondary carriers. You can configure up to 16 carriers. UE nodes initially connect to the gNB node on the primary carrier using theconnectUEfunction. You can assign additional carriers as secondary carriers to UE nodes using theaddSecondaryCarrierOnUEfunction.
The nrComponentCarrierConfig constructor can return either a single object or
multiple objects. For more information on how to create multiple carriers, see the
CarrierFrequency and NumContiguousCarriers properties of the nrComponentCarrierConfig object.
Note
When you configure multiple carriers for carrier aggregation using the
ComponentCarrierConfig property, the DuplexMode, CarrierFrequency, ChannelBandwidth, SubcarrierSpacing, NumResourceBlocks, DLULConfigTDD, and SRSPeriodicityUE properties of the nrGNB object do not
apply. These parameters are carrier-specific, and you must configure them within the
nrComponentCarrierConfig object(s).
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, represented as a positive integer. This value specifies a unique identifier for the node in the simulation.
Note
If you create and store the gNB 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.
Radio network temporary identifiers (RNTIs) of the UEs connected to a gNB node, represented as a vector of positive integers.
Data Types: double
Since R2024a
This property is read-only.
IDs of the UE nodes connected to the gNB node, represented as a vector of positive integers.
Data Types: double
Since R2024a
This property is read-only.
Names of the UE nodes connected to the gNB node, represented as a vector of strings.
This property is read-only.
MCS used for DL and UL, represented as a table. For more information about this property, see TS 38.214, table 5.1.3.1-2 [1].
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
Since R2026b
This property is read-only.
Information about UE nodes per carrier, represented as a scalar structure or a vector of structures. For single carrier operation, this property value is a scalar structure. For multiple carriers (carrier aggregation), it is a vector of structures, where element i contains information about UE nodes associated with the ith carrier.
Each structure contains these fields.
UERNTIs— RNTI of the UEs associated with the ith carrier, returned as vector of integersUENodeIDs— ID of the UEs associated with the ith carrier, returned as vector of integersUENodeNames— Name of the UEs associated with the ith carrier, returned as vector of strings
Note
The nrGNB object updates this property automatically when you
connect the UE nodes to gNB nodes using the connectUE
object function and add and activate secondary carriers on UE nodes by using the
addSecondaryCarrierOnUE object function.
Data Types: double
Object Functions
addSecondaryCarrierOnUE | Configure and activate secondary carriers on UE nodes |
configureScheduler | Configure scheduler at gNB |
configureULPowerControl | Configure uplink power control parameters |
connectUE | Connect one or more UEs to gNB |
addTrafficSource | Add data traffic source to 5G NR node |
registerEventCallback | Register callback for event from 5G node |
statistics | Statistics of gNB |
Examples
Create two similar gNB nodes, one with the name "gNB1" and the other named "gNB2", positioned at [100 100 0] and [5000 100 0], respectively.
gNBs = nrGNB(Name=["gNB1" "gNB2"],Position=[100 100 0; 5000 100 0])
gNBs = 1×2 nrGNB array
gNBs(1)
ans =
nrGNB with properties:
Position: [100 100 0]
Name: "gNB1"
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]
gNBs(2)
ans =
nrGNB with properties:
Position: [5000 100 0]
Name: "gNB2"
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: 2
Velocity: [0 0 0]
Constant properties:
MCSTable: [28×4 table]
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.104. “NR; Base Station (BS) radio transmission and reception.” 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.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
[4] 3GPP TS 38.321. “NR; Medium Access Control (MAC) protocol specification.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
[5] 3GPP TS 38.322. “NR; Radio Link Control (RLC) protocol specification.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
[6] 3GPP TS 38.213. “NR; Physical layer procedures for control.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.
Version History
Introduced in R2023aThe NumHARQ property now accepts integer values in the range [1,
32]. Previously, the maximum supported value was 16.
The scalar format for the CarrierFrequency property of the nrGNB object in FDD
mode will be removed in a future release.
Starting in R2026b, for FDD mode, you must specify the
CarrierFrequency property as a two-element row vector, where the
first element represents the downlink carrier frequency and the second element represents
the uplink carrier frequency.
In previous releases, you can specify CarrierFrequency as a scalar
and the nrGNB object automatically calculates the downlink and uplink
carrier frequencies based on the values of CarrierFrequency, the guard
band, and the channel bandwidth.
Use the ComponentCarrierConfig property to configure carrier
aggregation (multiple component carriers) on the gNB node. Specify
ComponentCarrierConfig as a single
nrComponentCarrierConfig object or a vector of
nrComponentCarrierConfig objects.
Use the addSecondaryCarrierOnUE function to configure and activate
secondary carriers on UE nodes for carrier aggregation. This enables a UE node to use
multiple frequency bands simultaneously.
Use the UEInfoPerCarrier property to obtain information about UE
nodes per carrier.
Use the ReceiverType property of nrGNB and
nrUE objects to specify the receiver algorithm. Specify it as one of
these options:
"mmse"— Minimum Mean square error (MMSE) receiver that minimizes the mean square error between transmitted and received signals."mmse-irc"— MMSE receiver with interference rejection combining.
Use these properties of the nrGNB and nrUE objects to
configure antenna array geometry and characteristics:
TransmitAntennaArray— Transmit antenna array configurationReceiveAntennaArray— Receive antenna array configurationTransmitArrayOrientation— Transmit antenna array orientationReceiveArrayOrientation— Receive antenna array orientationAntennaEfficiency— Antenna efficiency losses
Use the PHYModel property to specify the physical (PHY)
model type at object creation. Use PHYModel instead of the
PHYAbstractionMethod object property (to be removed).
Specify PHYModel as one of these options:
"abstract-phy"(default) — 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, this option does not involve waveform generation and decoding."full-phy"— Enable full PHY processing. Full PHY processing involves waveform generation and decoding.
The PHYAbstractionMethod property will be removed in a future
release.
Starting in R2026a:
Use the
PHYModelobject property instead, as described in this table.Remove Property Recommended Replacement PHYAbstractionMethod = "linkToSystemMapping"PHYModel = "abstract-phy"PHYAbstractionMethod = "none"PHYModel = "full-phy"The
PHYAbstractionMethodis hidden. If you setPHYAbstractionMethodat object creation, the object automatically sets thePHYModelproperty.
Starting in R2026a, this feature is available in 5G Toolbox™ and also requires a Wireless Network Toolbox license. In prior releases, the feature is available through the Communications Toolbox™ Wireless Network Simulation Library add-on.
The nrGNB object now includes Velocity and
Mobility properties that provide information about node velocity and
the configured mobility model, respectively. The value of the Mobility
property indicates the type of mobility object associated with the node, which you add using
the addMobility function. The value of the
Velocity property represents the current velocity at which the node
is moving.
Starting in R2026a, you can set the Name property only at object
creation. After creation, the property is read-only. In releases R2025b and before, after
object creation, you can set the value of this property for one node object at a
time.
The nrGNB object now enables you to configure SRS-based downlink
channel measurements through the SRSMeasurementConfigDL property.
The nrGNB object now enables you to register a function callback for a
specified event on the gNB nodes by using the registerEventCallback function.
The nrGNB object now allows you to specify the SRS transmission periodicity of a
UE node through the SRSPeriodicityUE name-value
argument.
The nrGNB object now allows you to access the IDs and names of the UE nodes
connected to a gNB node through the UENodeIDs and UENodeNames properties, respectively.
The nrGNB object now supports these functionalities.
Configure UL power control parameters through the
configureULPowerControlobject function.Select a PHY layer processing method through the PHYModel property.
See Also
Objects
nrUE|wirelessNetworkSimulator(Wireless Network Toolbox) |nrComponentCarrierConfig
Functions
Apps
- Wireless Network Modeler (Wireless Network Toolbox)
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)