Clear Filters
Clear Filters

How to control link power in system level 5G simulations?

6 views (last 30 days)
I am working on a 5G system-level simulation in MATLAB, which includes M gNBs and N UEs. I would like control the transmitted power to each UE separatly. Ideally, I would like to have a matrix of shape M x N where the cell (i, j) indicates the transmitted power from gNB-i to UE-j.
Since I am relatively new to MATLAB, I am basing my work on a specific example, so starting from there how can I achieve my needs stated above.
any guidance would be appreciated, thanks in advance.

Answers (1)

Maneet Kaur Bagga
Maneet Kaur Bagga on 26 Mar 2024
Hi,
As per my understanding you want to create a matrix with dimensions "M x N" where each cell should indicate the transmitted power from the ith gNB to the jth UE to control the transmitted power to each UE from each gNB. The following code assumes that the "5G Toolbox" and the "Wireless Network Simulation Library" are already installed in the system.
Initialize the network simulator and set up the basic parameters for simulation.
rng('default'); % For reproducibility
numFrameSimulation = 20; % Simulation time in frames (10 ms each)
networkSimulator = wirelessNetworkSimulator.init;
Define positions for gNBs and ensure the number of positions match the number of gNBs (M). For each gNB, create a corresponding set of UEs and connect these UEs to the gNBs. Add the gNBs and UEs to the network simulator for simulation.
% User-defined parameters
M = 3; % Number of gNBs
N = 4; % Number of UEs per cell
% Define gNB positions (example positions, adjust as needed)
gNBPositions = [1000, 1000, 30; 2000, 1000, 30; 1500, 2000, 30]; % Adjust according to M
gNBPositions = gNBPositions(1:M, :); % Ensure positions match the number of gNBs
gNBNames = "gNB-" + (1:M);
gNBs = nrGNB(Name=gNBNames, Position=gNBPositions, CarrierFrequency=2.5e9, ...
ChannelBandwidth=10e6, SubcarrierSpacing=30e3, TransmitPower=32, ReceiveGain=11);
% Generate UE positions and create UEs
cellRadius = 500; % Radius of each cell (in meters)
uePositions = generateUEPositions(cellRadius, gNBPositions, N); % Adjusted for N UEs per cell
UEs = cell(M, 1); % Adjusted for M cells
for cellIdx = 1:M
ueNames = "UE-" + (1:N) + "-Cell" + cellIdx; % Adjusted for N UEs per cell
UEs{cellIdx} = nrUE(Name=ueNames, Position=uePositions{cellIdx}, ReceiveGain=11);
connectUE(gNBs(cellIdx), UEs{cellIdx}, FullBufferTraffic="DL");
end
% Add nodes to the network simulator
addNodes(networkSimulator, gNBs);
for cellIdx = 1:M
addNodes(networkSimulator, UEs{cellIdx});
end
Configure the channel model, assuming a 3GPP TR 38.901 model
% Use 3GPP TR 38.901 channel model
channelModel = "3GPP TR 38.901";
configureChannelModel(networkSimulator, channelModel, gNBs, UEs);
Execute the simulation by calculating the total simulation time in seconds based on the number of frames.
% Set simulation parameters
enableTraces = true;
simulationTime = numFrameSimulation * 0.01; % Convert frames to seconds
% Run the simulation
run(networkSimulator, simulationTime);
Hope this helps!
  1 Comment
Zeyad
Zeyad on 26 Mar 2024
Thank you for responding, but this code won't allow me to configure the power per UE, right?
so basically for UEs connected to the same gNB will receive the same power, what I want is that each UE should receive a different power level, is that possible? also, I wonder if it is possible to change that power level during the simulation.
I need something as follows:-
Power allocation matrix
[10 dBm 5 dBm 1dBm 6 dBm;
1 dBm 2 dBm 4 dBm 4 dBm;
9 dBm 3 dBm 2 dBm 7 dBm]

Sign in to comment.

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!