nrGNB
Download Required: To use nrGNB
,
first download the Communications Toolbox Wireless Network Simulation Library add-on.
Description
Use the nrGNB
object to create and configure 5G new radio (NR)
base station (gNB) nodes.
Creation
Description
gnb = nrGNB
creates a default gNB object.
gnb = nrGNB(
creates one or more
similar gNB objects, and sets properties using one or more
optional name-value arguments. For example, Name=Value
)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.
Properties
Name
— Name of gNB node
character vector | string scalar | string array | cell array of character vectors
Name of the gNB 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 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: char
| string
Position
— Node position in 3-D Cartesian coordinates
[0 0 0]
(default) | three-element row vector | N-by-3
matrix
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
NoiseFigure
— Noise figure
6
(default) | nonnegative finite scalar
This property is read-only.
Noise figure, specified as a nonnegative finite scalar. Units are in dB.
To set the value of this property, you must specify it at object creation.
Data Types: double
ReceiveGain
— Receiver antenna gain
6
(default) | nonnegative finite scalar
This property is read-only.
Receiver antenna gain, specified as a nonnegative finite scalar. Units are in dB.
To set the value of this property, you must specify it at object creation.
Data Types: double
NumTransmitAntennas
— Number of transmit antennas
1
(default) | 2
| 4
| 8
| 16
| 32
This property is read-only.
Number of transmit antennas, specified as one of these options.
1
2
4
8
16
32
To set the value of this property, you must specify it at object creation.
Data Types: double
NumReceiveAntennas
— Number of receive antennas
1
(default) | 2
| 4
| 8
| 16
| 32
This property is read-only.
Number of receive antennas, specified as one of these options.
1
2
4
8
16
32
To set the value of this property, you must specify it at object creation.
Data Types: double
TransmitPower
— Transmit power
34
(default) | finite numeric scalar
This property is read-only.
Transmit power, specified as a finite numeric scalar. Units are in dBm. The maximum
value of transmit power you can specify is 60
dBm.
To set the value of this property, you must specify it at object creation.
Data Types: double
PHYAbstractionMethod
— PHY abstraction method
"linkToSystemMapping"
(default) | "none"
This property is read-only.
Physical (PHY) layer abstraction method, specified as one of these options. Note that all the gNB and user equipment (UE) nodes must use the same PHY abstraction method.
"linkToSystemMapping"
— 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."none"
— Enable full PHY processing. Full PHY processing involves waveform generation and decoding at the PHY layer.
To set the value of this property, you must specify it at object creation.
Data Types: char
| string
DuplexMode
— Duplexing mode
"FDD"
(default) | "TDD"
This property is read-only.
Duplexing mode, specified as one of these options.
"FDD"
— Frequency division duplex"TDD"
— Time division duplex
To set the value of this property, you must specify it at object creation.
Data Types: char
| string
CarrierFrequency
— Carrier frequency
2.6e9
(default) | real number
This property is read-only.
Carrier frequency, specified as a real number. Units are in Hz.
To set the value of this property, you must specify it at object creation.
Note
The value of the CarrierFrequency
property must be same for
all interfering gNBs.
Data Types: double
ChannelBandwidth
— Channel bandwidth
5e6
(default) | 10e6
| 15e6
| 20e6
| ...
This property is read-only.
Channel bandwidth, specified as one of these options. Units are in Hz.
5e6
10e6
15e6
20e6
30e6
35e6
40e6
45e6
50e6
60e6
70e6
80e6
90e6
100e6
200e6
400e6
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.
To set the value of this property, you must specify it at object creation.
Note
The value of the ChannelBandwidth
property must be same for
all interfering gNBs.
Data Types: double
SubcarrierSpacing
— Subcarrier spacing used across the cell
15e3
(default) | 30e3
| 60e3
| 120e3
This property is read-only.
Subcarrier spacing (SCS) used across the cell, specified as one of these options. Units are in Hz.
15e3
30e3
60e3
120e3
To set the value of this property, you must specify it at object creation.
Note
The value of the SubcarrierSpacing
property must be same for
all interfering gNBs.
Data Types: double
NumResourceBlocks
— Number of resource blocks in channel bandwidth
25
(default) | integer in range [4, 273]
This property is read-only.
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].
To set the value of this property, you must specify it at object creation.
Data Types: double
DLULConfigTDD
— DL and UL time division configuration for TDD mode
structure
This property is read-only.
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 theDLULPeriodicity
field is5
milliseconds,2.5
milliseconds,1.25
milliseconds, or0.625
milliseconds, 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).
To set the value of this property, you must specify it at object creation.
Dependencies
To enable this property, set the DuplexMode
property to "TDD"
.
NumHARQ
— Number of HARQ processes
16
(default) | integer in range [1, 16]
This property is read-only.
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, 16].
To set the value of this property, you must specify it at object creation.
Data Types: double
ID
— Node identifier
positive integer
This property is read-only.
Node identifier, returned 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
ConnectedUEs
— RNTIs of UEs
vector of positive integers
This property is read-only.
Radio network temporary identifiers (RNTIs) of the UEs connected to a gNB node, returned as a vector of positive integers.
Data Types: double
UENodeIDs
— IDs of the UE nodes connected to gNB
vector of positive integers
Since R2024a
This property is read-only.
IDs of the UE nodes connected to the gNB node, returned as a vector of positive integers.
Data Types: double
UENodeNames
— Names of the UE nodes connected to gNB
array of strings
Since R2024a
This property is read-only.
Names of the UE nodes connected to the gNB node, returned as an array of strings.
MCSTable
— MCS used for DL and UL
table
This property is read-only.
Modulation and coding scheme (MCS) used for DL and UL, returned as a table. For more information about this property, see TS 38.214, table 5.1.3.1-2 [1].
Object Functions
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 |
statistics | Statistics of gNB |
Examples
Create gNB Nodes
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 = 1x2 nrGNB array
gNBs(1)
ans = nrGNB with properties: Name: "gNB1" Position: [100 100 0] Read-only properties: NoiseFigure: 6 ReceiveGain: 6 TransmitPower: 34 NumTransmitAntennas: 1 NumReceiveAntennas: 1 PHYAbstractionMethod: "linkToSystemMapping" DuplexMode: "FDD" CarrierFrequency: 2.6000e+09 ChannelBandwidth: 5000000 SubcarrierSpacing: 15000 NumResourceBlocks: 25 NumHARQ: 16 ULPowerControlParameters: [1x1 struct] ID: 5 Constant properties: MCSTable: [28x4 table]
gNBs(2)
ans = nrGNB with properties: Name: "gNB2" Position: [5000 100 0] Read-only properties: NoiseFigure: 6 ReceiveGain: 6 TransmitPower: 34 NumTransmitAntennas: 1 NumReceiveAntennas: 1 PHYAbstractionMethod: "linkToSystemMapping" DuplexMode: "FDD" CarrierFrequency: 2.6000e+09 ChannelBandwidth: 5000000 SubcarrierSpacing: 15000 NumResourceBlocks: 25 NumHARQ: 16 ULPowerControlParameters: [1x1 struct] ID: 6 Constant properties: MCSTable: [28x4 table]
Establish Connection Between gNB and UE
Create a default gNB node.
gnb = nrGNB
gnb = nrGNB with properties: Name: "Node24" Position: [0 0 0] Read-only properties: NoiseFigure: 6 ReceiveGain: 6 TransmitPower: 34 NumTransmitAntennas: 1 NumReceiveAntennas: 1 PHYAbstractionMethod: "linkToSystemMapping" DuplexMode: "FDD" CarrierFrequency: 2.6000e+09 ChannelBandwidth: 5000000 SubcarrierSpacing: 15000 NumResourceBlocks: 25 NumHARQ: 16 ULPowerControlParameters: [1x1 struct] ID: 24 Constant properties: MCSTable: [28x4 table]
Create a default UE node.
ue = nrUE
ue = nrUE with properties: Name: "Node25" Position: [0 0 0] Read-only properties: NoiseFigure: 6 ReceiveGain: 0 TransmitPower: 23 NumTransmitAntennas: 1 NumReceiveAntennas: 1 PHYAbstractionMethod: "linkToSystemMapping" ConnectionState: "Idle" ID: 25
Establish a connection between the UE node and the gNB node.
connectUE(gnb,ue)
Create, Configure, and Simulate 5G Network
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);
Configure these uplink power control parameters at the gNB node.
Nominal transmit power of UE per resource block — 7 dBm
Fractional power control multiplier— 2
configureULPowerControl(gnb,PoPUSCH=7,Alpha=0.4)
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(GeneratePacket=true);
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);
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.
Version History
Introduced in R2023aR2024a: Includes support for accessing IDs and names of the UE nodes connected to a gNB node
The nrGNB object now allows you to access the IDs and names of the UE nodes
connected a gNB node through the UENodeIDs
and
UENodeNames
.
properties, respectively.
R2023b: Includes support for configuring UL power control parameters and selecting PHY layer processing method
The nrGNB object now supports these functionalities.
Configure UL power control parameters through the
configureULPowerControl
object function.Select a PHY layer processing method through the PHYAbstractionMethod property.
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)