0% found this document useful (0 votes)
259 views48 pages

5G Lab Manual

Uploaded by

harshit31jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
259 views48 pages

5G Lab Manual

Uploaded by

harshit31jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Experiment-1

Aim: Design and Simulate 5G Microstrip Antenna

Software Required: HFSS

Theory

The upgrade in the worldwide network requires immediate transformations in the devices to be
compatible with the new network. The entire communication system has to be reconfigured
without which the new network becomes redundant. However, the expeditious evolution would
bring changes in the antennas. Thus, the necessity of designing an antenna working in 5G
communication range has to be appreciated

Microstrip patch antennas are one of the most sought antennas in this regard. Due to their small
size and ease of fabrication, microstrip antennas are preferred across most of the communication
industries wherever low profile can be adapted. By most found adaptations in smartphones, their
ability of miniaturization of the entire circuit is a major advantage.

Micro strip antenna consists of a very thin metallic strip placed on a ground plane with a
di-electric material in-between. The radiating element and feed lines are placed by the process of
photo-etching on the di-electric material. Usually, the patch or micro-strip is chosen to be square,
circular or rectangular in shape for the ease of analysis and fabrication.

Formulas for design parameters:

Effective Dielectric Constant εreff is calculated as

Extension of length is due to fringing effect is calculated as ∆L


Length of Patch is L calculated by equation

Feedline Width Wf

Specifications of Antenna:

Substrate: Rogers RT Duroid 5880

Substrate dielectric: 2.2

Substrate height: 0.5 mm

Frequency: 28 GHz (5G Frequency)

Length and width of patch:…………….

Length and width of substrate:……….

Design Structure
Result: We have successfully designed and simulated 5G Microstrip patch antenna for 28 GHz
Frequency, The output obtained at 28 GHZ is minimum reflection coefficient (-15.6 dB).
Experiment-2

Aim: 5G Communications Link Analysis with Ray Tracing

Software Required: MATLAB

Theory

We can use ray tracing to analyze communication links and coverage areas in an urban
environment. It includes

● Import and visualize 3-D buildings data into Site Viewer

● Define a transmitter site and ray tracing propagation model corresponding to a 5G urban
scenario

● Analyze a link in non-line-of-sight conditions

● Visualize coverage using the shooting and bouncing rays (SBR) ray tracing method with
different numbers of reflections, diffractions, and launched rays

Define Transmitter Site

Define a transmitter site to model a small cell scenario in a dense urban environment. The
transmitter site represents a base station that is placed on a pole servicing the surrounding area
which includes a neighboring park. The transmitter uses the default isotropic antenna, and
operates at a carrier frequency of 28 GHz with a power level of 5 W.

View Coverage Map for Line-of-Sight Propagation

Create a ray tracing propagation model using the shooting and bouncing rays (SBR) method. The
SBR propagation model uses ray tracing analysis to compute propagation paths and their
corresponding path losses. Path loss is calculated from free-space loss, reflection and diffraction
loss due to interactions with materials, and antenna polarization loss.

Define Receiver Site in Non-Line-of-Sight Location

Define a receiver site to model a mobile receiver in an obstructed location. Plot the line-of-sight
path to show the obstructed path from the transmitter to the receive

Plot Propagation Path Using Ray Tracing


Adjust the ray tracing propagation model to include single-reflection paths, then plot the rays.
The result shows signal propagation along a single-reflection path. View the corresponding
propagation characteristics, including the received power, phase change, distance, and angles of
departure and arrival, by clicking on the plotted path.

Matlab code

viewer = siteviewer("Buildings","[Link]","Basemap","topographic");
tx = txsite("Name", "Small cell transmitter", "Latitude", 51.5054581, "Longitude", -0.0200490,
"AntennaHeight", 10, "TransmitterPower", 20, "TransmitterFrequency",28e9);
show(tx)
rtpm = propagationModel("raytracing", "Method", "sbr", "MaxNumReflections", 0,
"BuildingsMaterial", "perfect-reflector", "TerrainMaterial", "perfect-reflector");
coverage(tx, rtpm, "SignalStrengths", -120:-5, "MaxRange", 250, "Resolution", 3,
"Transparency", 0.6)
rx = rxsite("Name", "Small cell receiver", "Latitude", 51.5044579, "Longitude", -0.0171370,
"AntennaHeight", 1);
los(tx,rx)
[Link] = 1;
clearMap(viewer)
raytrace(tx,rx,rtpm)
%Compute the received power.%
ss = sigstrength(rx,tx,rtpm);
disp("Received power using perfect reflection: " + ss + " dBm")
%Update the model to use concrete for the buildings and terrain materials%
[Link] = "concrete";
[Link] = "concrete";
raytrace(tx,rx,rtpm)
ss = sigstrength(rx,tx,rtpm);
disp("Received power using concrete materials: " + ss + " dBm")
Output:
Result: We have successfully performed the analysis of 5G communication link using ray
tracing
Experiment-3

Aim: 5G Waveform Generation

Software Required: MATLAB

Theory:

The nrWaveformGenerator function provides a programmatic interface to configure the


waveform using a configuration object. Instead of specifying all parameters manually, which is
time consuming, you can configure the waveform in the 5G Waveform Generator app and export
this configuration to a MATLAB script. We can run this MATLAB script to generate the
configured 5G waveform.

Create a default downlink waveform configuration object. The waveconfig object contains the
full waveform specification and is fully configurable.

MATLAB code:

waveconfig = nrDLCarrierConfig
[waveform,waveformInfo] = nrWaveformGenerator(waveconfig);
%Plot spectrogram of waveform for first antenna port
samplerate = [Link](1).[Link];
nfft = [Link](1).[Link];
figure;
spectrogram(waveform(:,1),ones(nfft,1),0,nfft,'centered',samplerate,'yaxis','MinThreshold',-130);
title('Spectrogram of 5G Downlink Baseband Waveform');
[Link]{1}.PRBSet = 0:10;
[waveform,waveformInfo] = nrWaveformGenerator(waveconfig);
% Plot spectrogram of waveform for first antenna port
samplerate = [Link](1).[Link];
nfft = [Link](1).[Link];
figure;
spectrogram(waveform(:,1),ones(nfft,1),0,nfft,'centered',samplerate,'yaxis','MinThreshold',-130);
title('Spectrogram of 5G Downlink Baseband Waveform');
Output:

Result: The spectrogram of 5G waveform is successfully generated


Experiment-4

Aim: 5G Beamforming design

Software Required: MATLAB

Theory:

Modern wireless communication systems use spatial multiplexing to improve the data
throughput within the system in a scatterer-rich environment. In order to send multiple data
streams through the channel, a set of precoding and combining weights are derived from the
channel matrix. Then each data stream can be independently recovered. Those weights contain
both magnitude and phase terms and are normally applied in the digital domain.

Compared to current wireless systems, the wavelength in the mmWave band is much smaller.
Although this allows an array to contain more elements with the same physical dimension, it
becomes much more expensive to provide one TR module for each antenna element. Hence, as a
compromise, a TR switch is often used to supply multiple antenna elements. This is the same
concept as the subarray configuration used in the radar community.

The figure above shows that on the transmit side, the number of TR switches, NTRF, is smaller
than the number of antenna elements, NT. To provide more flexibility, each antenna element can
be connected to one or more TR modules. In addition, analog phase shifters can be inserted
between each TR module and antenna to provide some limited steering capability.
MATLAB Code

This section simulates a 64 x 16 MIMO hybrid beamforming system, with a 64-element square
array with 4 RF chains on the transmitter side and a 16-element square array with 4 RF chains on
the receiver side.

Nt = 64;
NtRF = 4;

Nr = 16;
NrRF = 4;
rng(4096);
c = 3e8;
fc = 28e9;
lambda = c/fc;
txarray = [Link](...
'Array',[Link]([sqrt(Nt) sqrt(Nt)],lambda/2),...
'SubarraySelection',ones(NtRF,Nt),'SubarraySteering','Custom');
rxarray = [Link](...
'Array',[Link]([sqrt(Nr) sqrt(Nr)],lambda/2),...
'SubarraySelection',ones(NrRF,Nr),'SubarraySteering','Custom');
rng(4096);
c = 3e8;
fc = 28e9;
lambda = c/fc;
txarray = [Link](...
'Array',[Link]([sqrt(Nt) sqrt(Nt)],lambda/2),...
'SubarraySelection',ones(NtRF,Nt),'SubarraySteering','Custom');
rxarray = [Link](...
'Array',[Link]([sqrt(Nr) sqrt(Nr)],lambda/2),...
'SubarraySelection',ones(NrRF,Nr),'SubarraySteering','Custom');
Ncl = 6;
Nray = 8;
Nscatter = Nray*Ncl;
angspread = 5;
% compute randomly placed scatterer clusters
txclang = [rand(1,Ncl)*120-60;rand(1,Ncl)*60-30];
rxclang = [rand(1,Ncl)*120-60;rand(1,Ncl)*60-30];
txang = zeros(2,Nscatter);
rxang = zeros(2,Nscatter);
% compute the rays within each cluster
for m = 1:Ncl
txang(:,(m-1)*Nray+(1:Nray)) = randn(2,Nray)*sqrt(angspread)+txclang(:,m);
rxang(:,(m-1)*Nray+(1:Nray)) = randn(2,Nray)*sqrt(angspread)+rxclang(:,m);
end

g = (randn(1,Nscatter)+1i*randn(1,Nscatter))/sqrt(Nscatter);
txpos = getElementPosition(txarray)/lambda;
rxpos = getElementPosition(rxarray)/lambda;
H = scatteringchanmtx(txpos,rxpos,txang,rxang,g);
F = diagbfweights(H);
F = F(1:NtRF,:);
pattern(txarray,fc,-90:90,-90:90,'Type','efield',...
'ElementWeights',F','PropagationSpeed',c);
Result: We have studied the basic concept of hybrid beamforming and shown how to split the
precoding and combining weights using an orthogonal matching pursuit algorithm.
Experiment-5

Aim: Frame Structure for 5G Technology

Software Required: MATLAB

Theory:

We are now going to parameterize and generate a 5G New Radio (NR) physical random access
channel (PRACH) waveform, as defined in TS 38.211. We demonstrate the parameterization and
generation of one PRACH configuration in a single carrier, and display the positions of the
PRACH preambles in the resource grid. We can define the length of the waveform, in terms of
subframes, and set the pattern of the active PRACH preambles in the generated waveform.

Waveform and Carrier Configuration

Configure one carrier and set the length of the generated waveform in terms of 1 ms subframes.
Visualize the generated resource grid by setting the DisplayGrids field to 1.

Use the waveconfig structure to store configuration parameters needed for the PRACH
waveform generation. The waveconfig structure contains these fields:

● NumSubframes: Number of 1 ms subframes in generated waveform.

● DisplayGrids: If set to 1, the example displays the resource grid.

● Windowing: Number of time-domain samples over which to apply windowing and


overlapping of OFDM symbols. For more information, see nrPRACHOFDMModulate.

● Carriers: Carrier-specific configuration object, as described in nrCarrierConfig.

● PRACH: Structure containing the PRACH-related configuration, as described in detail in


the PRACH Configuration section.

MATLAB Code:

waveconfig = [];
[Link] = 10; % Number of 1 ms subframes in generated waveform
[Link] = 1; % Display the resource grid
[Link] = []; % Use the default windowing

% Define a carrier configuration object


carrier = nrCarrierConfig;
[Link] = 15;
[Link] = 52;

% Store the carrier into the waveconfig structure


[Link] = carrier;
% PRACH configuration
prach = nrPRACHConfig;
[Link] = 'FR1'; % Frequency range ('FR1', 'FR2')
[Link] = 'FDD'; % Duplex mode ('FDD', 'TDD', 'SUL')
[Link] = 145; % Configuration index (0...255)
[Link] = 15; % Subcarrier spacing (1.25, 5, 15, 30, 60, 120)
[Link] = 0; % Index of the PRACH transmission occasions in frequency
domain (0...7)
[Link] = 2; % Index of the PRACH transmission occasions in time domain
(0...6)
[Link] = 0; % Active PRACH slot number within a subframe or a 60 kHz
slot (0, 1)

% Store the PRACH configuration and additional parameters in the waveconfig structure
[Link] = prach;
[Link] = 'all'; % Index of the allocated PRACH preambles
[Link] = 0; % PRACH power scaling in dB
[waveform,gridset,winfo] = hNRPRACHWaveformGenerator(waveconfig);
Result: We have shown how to generate a time-domain waveform for a single PRACH
configuration on a single carrier by studying the frame structure of 5G technology.
Experiment-6

Aim: Implement Numerology or subcarrier spacing in 5G

Software Required: MATLAB

Theory:

The baseband component carrier waveform is characterized by multiple subcarrier spacing (SCS)
carriers and bandwidth parts (BWP), and multiple sequences of PUSCH and SRS transmission
instances over the different BWPs.

Waveform and Carrier Configuration


Use the nrULCarrierConfig object to parameterize the baseband waveform generation. This
object contains a set of additional objects associated with the waveform channels and signals and
enables us to set these uplink carrier configuration parameters.
● Label for this UL carrier configuration
● SCS carrier bandwidth in resource blocks
● Carrier cell ID
● Length of the generated waveform in subframes
● Windowing
● Sample rate of the OFDM-modulated waveform
● Carrier frequency for symbol phase compensation

BWPs
A BWP is formed by a set of contiguous resources sharing a numerology on a given SCS carrier.
We can define multiple BWPs using a cell array. Each element in the cell array of
nrWavegenBWPConfig objects defines a BWP. For each BWP, we can specify the SCS, the
cyclic prefix (CP) length, and the bandwidth. The SubcarrierSpacing property links the BWP to
one of the SCS specific carriers defined earlier. The NStartBWP property controls the location of
the BWP in the carrier, relative to point A. NStartBWP is expressed in common resource blocks
(CRB) in terms of the BWP numerology. Different BWPs can overlap with each other.
MATLAB code

waveconfig = nrULCarrierConfig; % Create an uplink carrier configuration object

[Link] = 'UL carrier 1'; % Label for this uplink waveform configuration

[Link] = 0; % Cell identity

[Link] = 40; % Channel bandwidth (MHz)

[Link] = 'FR1'; % 'FR1' or 'FR2'

[Link] = 10; % Number of 1 ms subframes in generated waveform (1, 2,


4, 8 slots per 1 ms subframe, depending on SCS)

[Link] = 0; % Percentage of windowing relative to FFT length

[Link] = []; % Sample rate of the OFDM-modulated waveform

[Link] = 0; % Carrier frequency in Hz. This property is used for symbol


phase

% bandwidths and guardband requirements.

scscarriers = {nrSCSCarrierConfig,nrSCSCarrierConfig};
scscarriers{1}.SubcarrierSpacing = 15;

scscarriers{1}.NSizeGrid = 216;

scscarriers{1}.NStartGrid = 0;

scscarriers{2}.SubcarrierSpacing = 30;

scscarriers{2}.NSizeGrid = 106;

scscarriers{2}.NStartGrid = 1;

% BWP configurations

bwp = {nrWavegenBWPConfig,nrWavegenBWPConfig};

bwp{1}.BandwidthPartID = 1; % BWP ID

bwp{1}.Label = 'BWP 1 @ 15 kHz'; % Label for this BWP

bwp{1}.SubcarrierSpacing = 15; % BWP subcarrier spacing

bwp{1}.CyclicPrefix = 'Normal'; % BWP cyclic prefix for 15 kHz

bwp{1}.NSizeBWP = 25; % Size of BWP in PRBs

bwp{1}.NStartBWP = 10; % Position of BWP, relative to point A, in CRBs

bwp{2}.BandwidthPartID = 2; % BWP ID

bwp{2}.Label = 'BWP 2 @ 30 kHz'; % Label for this BWP

bwp{2}.SubcarrierSpacing = 30; % BWP subcarrier spacing

bwp{2}.CyclicPrefix = 'Normal'; % BWP cyclic prefix for 30 kHz

bwp{2}.NSizeBWP = 51; % Size of BWP in PRBs

bwp{2}.NStartBWP = 40; % Position of BWP, relative to point A, in CRBs

Result: We have successfully implemented numerology and subcarriers in 5G


Experiment-7

Aim: Spatial Multiplexing and Hybrid Beamforming for 5G Wireless Communications

Software Required: MATLAB

Theory:

The ever-growing demand for high data rate and more user capacity increases the need to use the
available spectrum more efficiently. Multi-user MIMO (MU-MIMO) improves the spectrum
efficiency by allowing a base station (BS) transmitter to communicate simultaneously with
multiple mobile stations (MS) receivers using the same time-frequency resources. Massive
MIMO allows the number of BS antenna elements to be on the order of tens or hundreds, thereby
also increasing the number of data streams in a cell to a large value.
5G wireless systems use millimeter wave (mmWave) bands to take advantage of their wider
bandwidth. The 5G systems also deploy large scale antenna arrays to mitigate severe propagation
loss in the mmWave band.

Hybrid Beamforming
Hybrid beamforming (also known as hybrid precoding) is a method that enables the use of
massive MIMO antenna arrays in a lower power and cost-efficient manner. In a traditional
antenna array, each antenna requires a dedicated RF chain to transmit and receive each data
stream; with hybrid precoding, each stream requires a dedicated RF chain. This greatly reduces
the number of RF chains, thus reducing cost and power. The analog outputs of each chain are
combined into a network of analog RF gains and phase shifters (the analog RF beamformer,
denoted Frf) that are connected to a large antenna array, where the number of antennas >>
number of streams. These analog units cannot change weights quickly; however the computed
RF weights change slowly over time since they are primarily determined by spatial positions of
receivers. The digital baseband precoding weights (denoted Fbb) may change from symbol to
symbol due to smaller-scale multipath effects, and may also be different from subcarrier to
subcarrier to account for frequency-selective fading.
Virtual Sectorization Using Joint Spatial Division Multiplexing
JSDM takes advantage of spatial clustering of users within the cell and groups these clusters to
create virtual sectors via RF analog beamforming to these groups. The spatial covariance
matrices of the groups are related to the spatial direction of the groups with respect to the base
station antenna array. These matrices are computed using the channel estimates produced from
the sounding signals, and the analog RF beams are derived from these matrices. These beams
focus transmitted energy to the respective groups and minimize intergroup interference.
MATLAB Code
s = rng(67); % Set RNG state for repeatability

[Link] = 28e9; % 28 GHz system

[Link] = 100e6; % Channel sampling rate, 100 Msps

[Link] = 'Scattering'; % Channel options: 'Scattering', 'MIMO'

[Link] = 8; % Noise figure (increase to worsen, 5-10 dB)

[Link] = 500; % Number of rays for Frf, Fbb partitioning

% Each user has the same modulation

[Link] = 4; % 2: QPSK, 4: 16QAM, 6: 64QAM, 8: 256QAM

[Link] = 10; % Number of OFDM data symbols


% Create a vector of users where each element is a user and the value of

% that element describes the number of independent data streams. For a

% single user case, make this a scalar value.

[Link] = [4 3 2 4 3]; % Number of independent data streams per user

[Link] = sum([Link]); % Must be a power of 2

[Link] = [Link]*8; % Number of BS transmit antennas (power of 2)

% The group assignments for the active users must be in ascending

% order. The default setting matches the group diagram above; there are two

% groups of users with the first three users assigned to group one and the

% last two users assigned to group two.

[Link] = [1 1 1 2 2]; % Describes which users are in which groups

[Link] = [Link]; % Number of independent data streams per user

[Link] = length([Link]); % Number of active users

[Link] = max([Link]); % Number of groups

numGroups = [Link];

if strcmp([Link],'Scattering')

for g = 1:numGroups

[Link]([Link]+g) = g;

[Link]([Link]+g) = 2;

end

end

% Define the center of each group's range, azimuth, and elevation,

% assuming the BS is at the origin.


% Angles specified as [azimuth;elevation] degrees

% Note: the number of columns must equal the number of groups

maxRange = 700; % all MSs within 700 meters of BS

groupRanges = randi([1 maxRange],1,numGroups);

groupAzimuth = -60 + 60/(numGroups+1) + ...

(120-(120/(numGroups+1)))/(numGroups-1) * (0:numGroups-1);

groupElevations = randi([-10 10],1,numGroups);

% Position mobile units

[Link] = length([Link]); % Number of connected users

if [Link] == 1

% For a single user, randomly place the user

% MS positions: assumes BS at origin

% Angles specified as [azimuth;elevation] degrees

% az in range [-180 180], el in range [-90 90], e.g. [45;0]

[Link] = randi([1 maxRange],1,[Link]);

[Link] = [rand(1,[Link])*360-180; ...

rand(1,[Link])*180-90];

else

% For multiple users, randomly place the users within their assigned

% group locations

[Link] = zeros([Link],1);

[Link] = zeros(2,[Link]);

for uIdx = 1:[Link]

g = [Link](uIdx);
[Link](uIdx) = groupRanges(g) + 30*rand(1);

[Link](:,uIdx) = ...

[groupAzimuth(g)+3*rand(1); groupElevations(g)+3*rand(1)];

end

end

Result: We have studied Spatial Multiplexing and Hybrid Beamforming for 5G Wireless
Communications
Experiment-8
Aim: Massive MIMO System Implementation with CSI

Software Required: MATLAB

Theory:

MIMO
The key aspects of MIMO include spatial multiplexing, precoding, channel measurement and
reporting.
Spatial multiplexing

Spatial multiplexing utilizes MIMO to perform multi-layer transmission. The minimum of


number of transmit and receive antennas limits the number of layers (or maximum rank). The
layer mapping process maps the modulated symbols of the codeword onto different layers. It
maps every nth symbol of the codeword to nth layer. For instance, this figure shows the mapping
of a codeword onto four layers.
Furthermore, in the DL direction, NR specification also allows two codewords and up to a
maximum of 8 transmission layers. The example currently only supports single codeword for
both DL and UL.
Precoding
Precoding, which follows the layer mapping, maps the transmission layers to antenna ports.
Precoding applies a precoding matrix to the transmission layers and outputs data streams to the
antenna ports.
Channel measurement and reporting

It consists of DL channel measurement and reporting by the UEs and UL channel measurement
by gNB.

MATLAB Code:
wirelessnetworkSupportPackageCheck

rng("default") % Reset the random number generator

numFrameSimulation = 10; % Simulation time in terms of number of 10 ms frames

networkSimulator = [Link];

Create a gNB. Specify the carrier frequency, number of transmit antennas, number of receive
antennas, and receive gain of the node.
gNB = nrGNB(CarrierFrequency=2.6e9,ChannelBandwidth=5e6,SubcarrierSpacing=15e3,...

NumTransmitAntennas=16,NumReceiveAntennas=8,ReceiveGain=11);

Create 4 UEs. Specify the name, position, number of transmit antennas, number of receive
antennas, and receive gain of each UE.
uePositions = [300 0 0; 700 0 0; 1200 0 0; 3000 0 0];

ueNames = "UE-" + (1:size(uePositions,1));

UEs =
nrUE(Name=ueNames,Position=uePositions,NumTransmitAntennas=4,NumReceiveAntennas=2
,ReceiveGain=11);

rlcBearerConfig = nrRLCBearerConfig(SNFieldLength=6,BucketSizeDuration=10);

connectUE(gNB,UEs,RLCBearerConfig=rlcBearerConfig)

Set the periodic DL and UL application traffic pattern for UEs.


appDataRate = 40e3; % Application data rate in kilo bits per second (kbps)

for ueIdx = 1:length(UEs)

% Install DL application traffic on gNB for the UE

dlApp =
networkTrafficOnOff(GeneratePacket=true,OnTime=numFrameSimulation*10e-3,...

OffTime=0,DataRate=appDataRate);

addTrafficSource(gNB,dlApp,DestinationNode=UEs(ueIdx))

% Install UL application traffic on UE for the gNB

ulApp =
networkTrafficOnOff(GeneratePacket=true,OnTime=numFrameSimulation*10e-3,...

OffTime=0,DataRate=appDataRate);

addTrafficSource(UEs(ueIdx),ulApp)

end

addNodes(networkSimulator,gNB)
addNodes(networkSimulator,UEs)

channelConfig = struct("DelayProfile","CDL-C","DelaySpread",300e-9);

channels = createCDLChannels(channelConfig,gNB,UEs);

customChannelModel = hNRCustomChannelModel(channels);

addChannelModel(networkSimulator,@[Link])

enableTraces = true;

Set up scheduling logger and phy logger.


if enableTraces

% Create an object for scheduler traces logging

simSchedulingLogger = helperNRSchedulingLogger(numFrameSimulation,gNB,UEs);

% Create an object for PHY traces logging

simPhyLogger = helperNRPhyLogger(numFrameSimulation,gNB,UEs);

end

numMetricsSteps = 10;

Set up metric visualizer.


metricsVisualizer =
helperNRMetricsVisualizer(gNB,UEs,NumMetricsSteps=numMetricsSteps,...

PlotSchedulerMetrics=true,PlotPhyMetrics=true);

simulationLogFile = "simulationLogs";

Run the simulation for the specified numFrameSimulation frames.

simulationTime = numFrameSimulation * 1e-2;

% Run the simulation

run(networkSimulator,simulationTime);
Result: Massive MIMO System is implemented with CSI
Experiment-9

Aim: Implement WINNER II 5G Channel Model and 3GPP

Software Required: MATLAB

Theory:

MIMO-OFDM systems are the norm in current wireless systems (e.g. 5G NR, LTE, WLAN) due
to their robustness to frequency-selective channels and high data rates enabled. With
ever-increasing demands on data rates supported, these systems are getting more complex and
larger in configurations with increasing number of antenna elements, and resources (subcarriers)
allocated.

With antenna arrays and spatial multiplexing, efficient techniques to realize the transmissions are
necessary [ 6 ]. Beamforming is one such technique, that is employed to improve the signal to
noise ratio (SNR) which ultimately improves the system performance, as measured here in terms
of bit error rate (BER) [ 1 ].
This experiment illustrates an asymmetric MIMO-OFDM single-user system where the
maximum number of antenna elements on transmit and receive ends can be 1024 and 32
respectively, with up to 16 independent data streams. It models a spatial channel where the array
locations and antenna patterns are incorporated into the overall system design. For simplicity, a
single point-to-point link (one base station communicating with one mobile user) is modeled.
The link uses channel sounding to provide the transmitter with the channel information it needs
for beamforming.
The example offers the choice of a few spatially defined channel models, specifically a
WINNER II Channel model and a scattering-based model, both of which account for the
transmit/receive spatial locations and antenna patterns.

Channel Sounding
For a spatially multiplexed system, availability of channel information at the transmitter allows
for precoding to be applied to maximize the signal energy in the direction and channel of interest.
Under the assumption of a slowly varying channel, this is facilitated by sounding the channel
first, wherein for a reference transmission, the receiver estimates the channel and feeds this
information back to the transmitter.
For the chosen system, a preamble signal is sent over all transmitting antenna elements, and
processed at the receiver accounting for the channel. The receiver components perform
pre-amplification, OFDM demodulation, frequency domain channel estimation, and calculation
of the feedback weights based on channel diagonalization using singular value decomposition
(SVD) per data subcarrier.
MATLAB code
s = rng(61); % Set RNG state for repeatability

% Single-user system with multiple streams

[Link] = 1; % Number of users

[Link] = 16; % Number of independent data streams, 4/8/16/32/64

[Link] = 32; % Number of transmit antennas

[Link] = 16; % Number of receive antennas

[Link] = 6; % 2: QPSK, 4: 16QAM, 6: 64QAM, 8: 256QAM

[Link] = 10; % Number of OFDM data symbols

[Link] = 4e9; % 4 GHz system

[Link] = 100e6; % Channel sampling rate, 100 Msps

[Link] = 'Scattering'; % Channel options: 'WINNER', 'Scattering',

% 'ScatteringFcn', 'StaticFlat'

[Link] = 5; % Noise figure, dB

% Array locations and angles

[Link] = [0;0;0]; % BS/Transmit array position, [x;y;z], meters

[Link] = 300; % meters

% Angles specified as [azimuth;elevation], az=[-90 90], el=[-90 90]

[Link] = [33; 0]; % degrees

[Link] = [30; -20]; % Transmit steering angle (close to mobileAngle)

[Link] = true; % Enable/disable steering

Parameters to define the OFDM modulation employed for the system are specified below.
[Link] = 256;

[Link] = 64;

[Link] = 234;

[Link] = [7 6];

[Link] = [26 54 90 118 140 168 204 232];

nonDataIdx = [(1:[Link](1))'; [Link]/2+1; ...

([Link](2)+1:[Link])'; ...

[Link].';];

[Link] = setdiff((1:[Link])',sort(nonDataIdx));

numTx = [Link];

numRx = [Link];

numSTS = [Link];

[Link] = numSTS*[Link]*[Link]* ...

[Link]*1/3-6; % Account for termination bits

[Link] = 2^[Link]; % Modulation order

% Account for channel filter delay

[Link] = 3*([Link]+[Link]);

% Get transmit and receive array information

[Link] = numSTS;

[isTxURA,expFactorTx,isRxURA,expFactorRx] = helperArrayInfo(prm,true);

Channel Sounding
% Generate the preamble signal
preambleSigSTS = helperGenPreamble(prm);

% repeat over numTx

preambleSig = zeros(size(preambleSigSTS,1),numTx);

for i = 1:numSTS

preambleSig(:,(i-1)*expFactorTx+(1:expFactorTx)) = ...

repmat(preambleSigSTS(:,i),1,expFactorTx);

end

% Transmit preamble over channel

[rxPreSig,chanDelay] = helperApplyChannel(preambleSig,prm,spLoss);

% Front-end amplifier gain and thermal noise

rxPreAmp = [Link]( ...

'Gain',gainFactor*spLoss, ... % account for path loss

'NoiseFigure',[Link], ...

'ReferenceTemperature',290, ...

'SampleRate',[Link]);

rxPreSigAmp = rxPreAmp(rxPreSig);

rxPreSigAmp = rxPreSigAmp * ... % scale power

(sqrt([Link]-sum([Link])-1)/([Link]));

% OFDM Demodulation

demodulatorOFDM = [Link]( ...

'FFTLength',[Link], ...

'NumGuardBandCarriers',[Link].', ...
'RemoveDCCarrier',true, ...

'PilotOutputPort',true, ...

'PilotCarrierIndices',[Link].', ...

'CyclicPrefixLength',[Link], ...

'NumSymbols',numSTS, ... % preamble symbols alone

'NumReceiveAntennas',numRx);

rxOFDM = demodulatorOFDM( ...

rxPreSigAmp(chanDelay+1:end-([Link]-chanDelay),:));

% Channel estimation from preamble

% numCarr, numSTS, numRx

hD = helperMIMOChannelEstimate(rxOFDM(:,1:numSTS,:),prm);

% Calculate the feedback weights

v = diagbfweights(hD);

For conciseness in presentation, front-end synchronization including carrier and timing recovery
are assumed. The weights computed using diagbfweights are hence fed back to the transmitter,
for subsequent application for the actual data transmission.

Transmit Beam Steering


% Gain per antenna element

amplifier = [Link]('PeakPower',1/numTx,'Gain',0);

% Amplify to achieve peak transmit power for each element

for n = 1:numTx

txSig(:,n) = amplifier(txSig(:,n));
end

% Transmit antenna array definition

if isTxURA

% Uniform Rectangular array

arrayTx = [Link]([expFactorTx,numSTS],[0.5 0.5]*[Link], ...

'Element',[Link]('BackBaffled',true));

else

% Uniform Linear array

arrayTx = [Link](numTx, ...

'ElementSpacing',0.5*[Link], ...

'Element',[Link]('BackBaffled',true));

end

% For evaluating weights for steering

SteerVecTx = [Link]('SensorArray',arrayTx, ...

'PropagationSpeed',[Link]);

% Generate weights for steered direction

wT = SteerVecTx([Link],[Link]);

% Radiate along the steered direction, without signal combining

radiatorTx = [Link]('Sensor',arrayTx, ...

'WeightsInputPort',true, ...

'PropagationSpeed',[Link], ...
'OperatingFrequency',[Link], ...

'CombineRadiatedSignals',false);

if [Link]

txSteerSig = radiatorTx(txSig,repmat([Link],1,numTx), ...

conj(wT));

else

txSteerSig = txSig;

end

% Visualize the array

h = figure('Position',figposition([10 55 22 35]),'MenuBar','none');

[Link] = 'Transmit Array Geometry';

viewArray(arrayTx);

% Visualize the transmit pattern and steering

h = figure('Position',figposition([32 55 22 30]),'MenuBar','none');

[Link] = 'Transmit Array Response Pattern';

pattern(arrayTx,[Link],'PropagationSpeed',[Link],'Weights',wT);

h = figure('Position',figposition([54 55 22 35]),'MenuBar','none');

[Link] = 'Transmit Array Azimuth Pattern';

patternAzimuth(arrayTx,[Link],'PropagationSpeed',[Link],'Weights',wT);

if isTxURA

h = figure('Position',figposition([76 55 22 35]),'MenuBar','none');

[Link] = 'Transmit Array Elevation Pattern';


patternElevation(arrayTx,[Link],'PropagationSpeed',[Link], ...

'Weights',wT);

end
Result: We have Implemented WINNER II 5G Channel Model and 3GPP
Experiment-10

Aim: Evaluating the Performance of 5G Modulation and Access Schemes

Software Required: MATLAB

Theory:

Downlink beamforming improves the network performance by utilising the multi-antenna


configuration to focus energy of the signals in a direction which results in better SNR at a UE.
Additionally, beamforming also limits the interference in other directions. For efficient DL
beamforming, gNB relies on the channel state information resource indicator (CRI) and
L1-RSRP feedback from the UEs. The UEs measure the L1-RSRP on multiple CSI-RS resources
where each resource corresponds to one direction, and reports the gNB with the CRI having the
highest L1-RSRP.
The example models multiple sets of CSI-RS beams for L1-RSRP measurements. Each set
corresponds to a wider synchronization signal block (SSB) beam and contains finer CSI-RS
beams within the SSB beam. The example does not model the SSB beam sweeping process for
initial acquisition, and assumes the SSB beam associated with each UE to be the beam with
angular range covering the line-of-sight path from the gNB.
· Free space path loss (FSPL), additive white Gaussian noise (AWGN), and
clustered delay line (CDL) propagation channel model.
Nodes send the control packets (buffer status report (BSR), DL assignment, UL grants, PDSCH
feedback, CSI report, and CRI-RSRP reports) out of band, without the need of resources for
transmission and assured error-free reception.

MIMO
The key aspects of multiple-input multiple-output (MIMO) include precoding, beamforming,
channel measurement and reporting.

Layer mapping
The layer mapping process maps the modulated symbols of the codeword onto different layers.
Precoding
Precoding, which follows the layer mapping, maps the transmission layers to antenna ports.
Precoding applies a precoding matrix to the transmission layers and outputs data streams to the
antenna ports.
Beamforming
Beamforming involves the use of multiple radiating elements transmitting the same signal to
produce a longer and narrower beam in a particular direction. The higher the number of
antennas, the narrower the beamwidth.
DL Channel Measurement and Reporting

MATLAB code

wirelessnetworkSupportPackageCheck

%Configure simulation parameters in the simParameters structure.

rng('default'); % Reset the random number generator

simParameters = []; % Clear the simParameters variable

[Link] = 10; % Simulation time in terms of number of 10 ms frames

%Enable or disable DL beamforming.

enableBeamforming = true;
% Specify the azimuth sweep angles and direction of SSBs.

% Azimuth angle is the angle measured in the horizontal plane ranging from [-180, 180] and

% Elevation angle is the angle measured in the vertical plane ranging from [-90, 90] between
horizontal plane and line of sight (LOS) point in the Spherical coordinate system.

if enableBeamforming

% Number of SSBs

numSSBs = 4;

% Total azimuthal range for all SSBs corresponding to a 120 degrees sectorized cell

azSweepRange = [-60, 60];

validateattributes(azSweepRange,{'numeric'},{'nonempty','real', 'vector', '>=',-60,'<=',60,


'finite'}, 'azSweepRange','azimuthal range');

% Sweep range for non-overlapping SSB directions++9365

ssbSweepRange = diff(azSweepRange)/numSSBs;

% Azimuthal angles for SSB beam sweeping in the azimuthal range

ssbTxAngles = [-60 -20 20 60];

% Elevation range for all SSBs sweeping in the azimuthal angles

elSweepRange = [-45, 0];

end

[Link] = 3;

% Position of gNB in (x,y,z) coordinates

[Link] = [0, 0, 0];

% Specify UE position in spherical coordinates (r,azimuth,elevation)

% relative to gNB. Here 'r' is the distance, 'azimuth' is the angle in the

% horizontal plane and elevation is the angle in the vertical plane. When

% beamforming is enabled, all the UE positions must lie with in the azimuth

% and elevation range limits of SSBs as defined above. It is a matrix of


% size N-by-3 where N is the number of UEs. Row 'i' of the matrix contains

% the coordinates of UE with RNTI 'i'

ueRelPosition = [500, -5, -5;

500, -60, -30;

500, -10, -20];

if enableBeamforming

validateattributes(ueRelPosition(:,2),{'numeric'},{'nonempty','real','vector',
'>=',azSweepRange(1),'<=',azSweepRange(2),'finite'}, ...

'ueRelPosition(:,2)','azimuth angles');

validateattributes(ueRelPosition(:,3),{'numeric'},{'nonempty','real','vector',
'>=',elSweepRange(1),'<=',elSweepRange(2),'finite'}, ...

'ueRelPosition(:,3)','elevation angles');

end

% Convert Spherical to Cartesian coordinates considering gNB position as origin

[xPos, yPos, zPos] = sph2cart(deg2rad(ueRelPosition(:, 2)),deg2rad(ueRelPosition(:, 3)),


ueRelPosition(:, 1));

% Global coordinates of UEs

[Link] = [xPos, yPos, zPos] + [Link];

% Validate the UE positions

validateattributes([Link], {'numeric'},{'nonempty','real',
'nrows',[Link],'ncols',3,'finite'}, '[Link]','UEPosition');

% Set the channel bandwidth to 5 MHz and the subcarrier spacing (SCS) to 15 kHz as defined in
3GPP TS 38.104 Section 5.3.2.

[Link] = 25;

[Link] = 15; % kHz

[Link] = 5e6; % Hz

[Link] = 5e6; % Hz
[Link] = 2.646e9; % Hz

[Link] = 2.535e9; % Hz

gNBTxArraySize = [2 4 2];

ueRxArraySize = repmat([1 1 2],[Link],1);

% Configure the gNB transmit antenna panel.

lambda = physconst('LightSpeed')/[Link];

[Link] = [Link]('ElementSet',
repmat({[Link]},1,gNBTxArraySize(3)), 'Size',[gNBTxArraySize(1:2) 1
1],'Spacing', [0.5*lambda 0.5*lambda 1 1]);

% Specify the CSI-RS configuration for RI, PMI and CQI measurements.

csirs = cell(1,[Link]);

csirsOffset = [5 6 10 11];

for csirsIdx = 1:[Link]

csirs{csirsIdx} = nrCSIRSConfig('NID',1,'NumRB',[Link],
'RowNumber',11,'SubcarrierLocations',[1 3 5 7], 'SymbolLocations',0,'CSIRSPeriod',[20
csirsOffset(csirsIdx)]);

end

[Link] = csirs;

if enableBeamforming

[Link] = 4;

csirsConfigRSRP = cell(1,numSSBs);

for ssbIdx = 1:numSSBs

csirsConfig = nrCSIRSConfig;

[Link] = 1;

[Link] = repmat({'nzp'},1,[Link]);

[Link] = [40 0];

[Link] = repmat({'one'},1,[Link]);
[Link] = repmat(2,1,[Link]);

[Link] = {1,5,6,7};

[Link] = repmat({ssbIdx-1},1, [Link]);

[Link] = [Link];

csirsConfigRSRP{ssbIdx} = csirsConfig;

end

[Link] = csirsConfigRSRP;

end
Result: We have Evaluated the Performance of 5G Modulation and Access Schemes

You might also like