0% found this document useful (0 votes)
13 views

4G 5G Lab Manual

Uploaded by

gkplay143
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)
13 views

4G 5G Lab Manual

Uploaded by

gkplay143
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
You are on page 1/ 45

DMI COLLEGE OF ENGINEERING

(AN AUTONOMOUS INSTITUTION)

PALANCHUR, CHENNAI-602 123

DEPARTMENT OF ELECTRONICS AND


COMMUNICATION ENGINEERING

CEC331-4G/5G COMMUNICATION NETWORKS


B.E / B.TECH DEGREE EXAMINATION SEMESTER – V ACADEMIC YEAR
2024-2025
DMI COLLEGE OF ENGINEERING
PALANCHUR, NAZARATHPET, CHENNAI-600123.

BONAFIDE CERTIFICAT
BONAFIDE CERTIFICATE
UNIVERSITY REGISTER NUMBER:

Certified that this is bonafide record of practical work done by

Mr./Ms………………………….……..……………………………of …………………………………………....

Department in the ………………………………………………………………………………………………

Laboratory during the semester ……………………… year........................................... and

Submitted for the University Practical Examination conducted on............................At

DMI College of Engineering, Palanchur,Chennai.

Lab In-Charge Head of the Department

Internal Examiner External Examiner


VISION OF THE DEPARTMENT

To develop committed and competent technologists in electronics and communication engineering to


be on par with global standards coupled with cultivating the innovations and ethical values.

MISSION OF THE DEPARTMENT:


DM 1: To be a centre of excellence in teaching learning process promoting active learning with
critical thinking.
DM 2: To strengthen the student’s core domain and to sustain collaborative industry interaction
with internship and incorporating entrepreneur skills.
DM 3: To prepare the students for higher education and research-oriented activities imbibed with
ethical values for addressing the social need.
PROGRAM EDUCATIONAL OBJECTIVES (PEOs):
PEO1. CORE COMPETENCY WITH EMPLOYABILITY SKILLS: Building on
fundamental knowledge, to analyze, design and implement electronic circuits and systems in
Electronics and Communication Engineering by applying knowledge of mathematics and science or in
closely related fields with employ-ability skills.
PEO2. PROMOTE HIGHER EDUCATION AND RESEARCH AND DEVELOPMENT:
To develop the ability to demonstrate technical competence and innovation that initiates interest for
higher studies and research.
PEO3. INCULCATING ENTREPRENEUR SKILLS: To motivate the students to become
Entrepreneurs in multidisciplinary domain by adapting to the latest trends in technology catering the
social needs.
PEO4. ETHICAL PROFESSIONALISM: To develop the graduates to attain professional excellence
with ethical attitude, communication skills, team work and develop solutions to the problems and
exercise their capabilities.
PROGRAM OUTCOMES (POs)
1. Knowledge: Apply the knowledge of mathematics, science, engineering fundamentals and an
engineering specialization to the solution of complex engineering problems.
2. Problem Analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics, natural
sciences, and engineering sciences.
3. Design / Development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration
for the public health and safety, and the cultural, societal, and environmental considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
7. Environment and sustainability: Understand the impact of the professional engineering solutions
in societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms
of the engineering practice.
9. Individual and team work: Function effectively as an individual and as a member or leader in
diverse teams, and in multidisciplinary settings.

10. Communication: Communicate effectively on complex engineering activities with the


engineering community and with society at large, such as, being able to comprehend and write effective
reports and design documentation, make effective presentations, and give and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering management principles and apply these to one’s own work, as a member and leader in a
team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for and have the preparation and ability to engage in
independent and lifelong learning in the broadest context of technological change.
PROGRAM SPECIFIC OUTCOMES (PSOs):

PSO1. Analyze and design the analog and digital circuits or systems for a given specification and
function.

PSO2. Implement functional blocks of hardware-software co-designs for signal processing and
communication applications.

PSO3. Design, develop and test electronic and embedded systems for applications with real time
constraint and to develop managerial skills with ethical behavior to work in a sustainable environment.
INSTRUCTIONS TO STUDENTS FOR WRITING THE RECORD

In the record, the index page should be filled properly by writing the corresponding experiment
number, experiment name, date on which it was done and the page number.

On the right-side page of the record following has to be written:

1. Title: The title of the experiment should be written in the page in capital letters. In the left top margin,
experiment number and date should be written.
2. Aim: The purpose of the experiment should be written clearly.
3. Apparatus/Tools/Equipment’s/Components used: A list of the Apparatus/Tools/ Equipment’s/
Components used for doing the experiment should be entered.
4. Theory: Simple working of the circuit/experimental set up/algorithm should be written.
5. Procedure: Steps for doing the experiment and recording the readings should be briefly described (flow
chart/ Circuit Diagrams / programs in the case of computer/processor related experiments)
6. Results: The results of the experiment must be summarized in writing and should be fulfilling the aim.

On the Left side page of the record following has to be recorded:

a) Circuit/Program: Neatly drawn circuit diagrams for the experimental set up.
b) Design: The design of the circuit components for the experimental set up
for selecting the components should be clearly shown if necessary.

OBSERVATIONS:

i. Data should be clearly recorded using Tabular Columns.


ii. Unit of the observed data should be clearly mentioned
iii. Relevant calculations should be shown. If repetitive calculations are needed,
only show a sample calculation and summarize the others in a table.
4G/5G COMMUNICATION NETWORKS L T P C
CEC331
LABORATORY 2 0 2 3

COURSE OBJECTIVES

• To learn the evolution of wireless networks.


• To get acquainted with the fundamentals of 5G networks.
• To study the processes associated with 5G architecture.
• To study spectrum sharing and spectrum trading.
• To learn the security features in 5G networks.

LIST OF EXPERIMENTS:

SIMULATION USING MATLAB

1. 5G-Compliant waveform generation and testing


2. Modeling of 5G Synchronization signal blocks and bursts
3. Channel modeling in 5G networks
4. Multiband OFDM demodulation
5. Perfect Channel estimation
6. Development of 5g New Radio Polar Coding

CONTENT BEYOND SYLLABUS:


1. OFDM waveform Configuration, Constellation diagram Using MATLAB 2023a APP.
2. QAM waveform Configuration, Constellation diagram Using MATLAB 2023a APP.
3. PSK waveform Configuration, Constellation diagram Using MATLAB 2023a APP.

COURSE OUTCOMES:
Students will be able to:

CO1: To understand the evolution of wireless networks


CO2: To learn the concepts of 5G networks.
CO3: To comprehend the 5G architecture and protocols.
CO4: To understand the dynamic spectrum management.
CO5: To learn the security aspects in 5G networks.
CO-PO Mapping Matrix:

Course
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
Outcome
CO1 3 3 2 3 2 - - - - - - -
CO2 3 3 3 2 2 - - - - - - -
CO3 3 3 2 2 2 - - - - - - -
CO4 3 3 3 3 2 - - - - - - -
CO5 3 2 3 3 2 - - -- - - - -
AVG. 3 2.8 2.6 2.6 2 - - - - - - -
Note: Enter correlation levels 1, 2 or 3 as defined below:
1: Slight (Low) 2: Moderate (Medium) 3: Substantial (High)

CO-PSO matrices:
Course
PSO1 PSO2 PSO3
Outcome
CO1 1 1 3
CO2 1 1 2
CO3 3 2 2
CO4 3 2 2
CO5 3 2 2
AVG. 2.2 1.6 2.2
INDEX

EXP NO DATE LIST OF EXPERIMENT PAGE NO SIGN


EXP 1 5G-COMPLIANT WAVEFORM GENERATION AND TESTING

AIM:
Develop a MATLAB program to model 5G Synchronization Signal Blocks (SSBs) and Bursts.

APPARATUS REQUIRED:
Hardware: Personal computer
Software : MATLAB , 5G Toolbox, knowledge of 5G NR standard.

PROCEDURE:
1. Start the MATLAB 2023a
2. Open M file
3. Type the program
4. Save in the current Directory
5. Compile and Run the Program
6. If any error occurs in the program correct and run it again
7. For the output see current window/ Figure window
8. Stop the Program.
THEORY:
1. Waveform Design: The first step in the generation of a 5G compliant waveform is to design the
waveform. This involves selecting the modulation type, the number of subcarriers, the number of
symbols, and the symbol rate.
2. Channel Estimation: The next step is to estimate the channel characteristics. This is done by
measuring the signal strength and the noise level at the receiver.

3. Equalization: Once the channel characteristics are known, the signal can be equalized to reduce the
effects of noise and interference. This is done by applying a filter to the signal.

4. Modulation: The signal is then modulated using the chosen modulation type. This involves mapping
the data onto the signal in a way that is compatible with the 5G standard.

4. Waveform Generation: Finally, the waveform is generated by combining the modulated signal with
the equalized signal.
CODING: %GENERATION OF 5G COMPLIANT SIGNAL

%Define the parameters


fc = 28e9; %carrier frequency
fs = 30e9; %sampling frequency
N = 1024; %number of samples

%Generate the signal


t = 0:1/fs:N/fs-1/fs; %time vector
x = cos(2*pi*fc*t); %signal

%Plot the signal


figure;
plot(t,x);
title('5G Compliant Signal');
xlabel('Time (s)');
ylabel('Amplitude');

%Testing of 5G compliant signal

%Define the parameters


fc_test = 28e9; %carrier frequency
fs_test = 30e9; %sampling frequency
N_test = 1024; %number of samples
%Generate the signal
t_test = 0:1/fs_test:N_test/fs_test-1/fs_test; %time vector
x_test = cos(2*pi*fc_test*t_test); %signal

%Calculate the power spectral density


[Pxx,f] = periodogram(x_test,[],N_test,fs_test);
%Plot the power spectral density
figure;
plot(f,Pxx);
title('Power Spectral Density of 5G Compliant Signal');
xlabel('Frequency (Hz)');
ylabel('Power Spectral Density (dB/Hz)');
RESULT:
Thus the 5G Complaint waveform were generated and the Power spectral Density of the generated
signal were tested successfully.
OFDM WAVEFORM.

%% Generating OFDM waveform


% OFDM configuration
ofdmMod = comm.OFDMModulator(‘FFTLength’, 64, …
‘NumGuardBandCarriers’, [6;5], …
‘InsertDCNull’, false, …
‘CyclicPrefixLength’, 16, …
‘Windowing’, false, …
‘OversamplingFactor’, 1, …
‘NumSymbols’, 100, …
‘NumTransmitAntennas’, 1, …
‘PilotInputPort’, false);

scs = 1000000;
M = 4; % Modulation order
% input bit source:
in = randi([0 1], 10600, 1);

dataInput = qammod(in, M, ‘gray’, ‘InputType’, ‘bit’, ‘UnitAveragePower’, true);


ofdmInfo = info(ofdmMod);
ofdmSize = ofdmInfo.DataInputSize;
dataInput = reshape(dataInput, ofdmSize);

% Generation
waveform = ofdmMod(dataInput);

Fs = ofdmMod.FFTLength * scs * ofdmMod.OversamplingFactor;


% Specify the sample rate of the waveform in Hz
%% Visualize
% Spectrum Analyzer
spectrum = spectrumAnalyzer(‘SampleRate’, Fs);
spectrum(waveform);
release(spectrum);
% Constellation Diagram
constel = comm.ConstellationDiagram(‘ColorFading’, true, …
‘ShowTrajectory’, 0, …
‘ShowReferenceConstellation’, false);
constel(waveform);
release(constel);

% OFDM Subcarrier Mapping


showResourceMapping(ofdmMod);

OUTPUT:
QAM WAVEFORM:

%% Generating QAM waveform


% QAM configuration
M = 4; % Modulation order
% input bit source:
in = randi([0, 1], 60000, 1);
% Generation
waveform = qammod(in, M, 'gray', 'InputType', 'bit', 'UnitAveragePower', true);

Fs = 1000; % Specify the sample rate of the waveform in Hz

%% Visualize
% Time Scope
timeScope = timescope('SampleRate', Fs, ...
'TimeSpanOverrunAction', 'scroll', ...
'TimeSpanSource', 'property', ...
'TimeSpan', 0.03);
timeScope(waveform);
release(timeScope);

% Spectrum Analyzer
spectrum = spectrumAnalyzer('SampleRate', Fs);
spectrum(waveform);
release(spectrum);

% Constellation Diagram
constel = comm.ConstellationDiagram('ColorFading', true, ...
'ShowTrajectory', 0, ...
'ShowReferenceConstellation', false);
constel(waveform);
release(constel);
OUTPUT:
PSK WAVEFORM:

%% Generating PSK waveform


% PSK configuration
M = 4; % Modulation order
% input bit source:
in = randi([0, 1], 60000, 1);
usedInput = in(1:log2(M)*(floor(length(in)/log2(M))));
symbolInput = bit2int(usedInput, log2(M));
% Generation
phaseOffset = pi/M;
waveform = pskmod(symbolInput, M, phaseOffset, ‘gray’);
Fs = 1000; % Specify the sample rate of the
waveform in Hz
%% Visualize
% Time Scope
timeScope = timescope(‘SampleRate’, Fs, …
‘TimeSpanOverrunAction’, ‘scroll’, …
‘TimeSpanSource’, ‘property’, …
‘TimeSpan’, 0.03);
timeScope(waveform);
release(timeScope);
% Spectrum Analyzer
spectrum = spectrumAnalyzer(‘SampleRate’, Fs);
spectrum(waveform);
release(spectrum);
% Constellation Diagram
constel = comm.ConstellationDiagram(‘ColorFading’, true, …
‘ShowTrajectory’, 0, …
‘ShowReferenceConstellation’, false);
constel(waveform);
release(constel);
OUTPUT:

RESULT:

Thus the Constellation diagram, Time scope and Frequency plots were generated and

the 5G Complaint waveform for OFDM,QAM and PSK were tested successfully.
EXP:2 MODELING 5G SYNCHRONIZATION SIGNAL BLOCKS (SSBS) AND BURSTS

AIM:
Develop a MATLAB program to model 5G Synchronization Signal Blocks (SSBs) and Bursts.

APPARATUSREQUIRED:
Hardware: Personal computer
Software :MATLAB , 5GToolbox,knowledge of 5G NR standard.

PROCEDURE:
1. Start the MATLAB 2023a
2. Open M file
3. Type the program
4. Save in the current Directory
5. Compile and Run the Program
6. If any error occurs in the program correct and run it again
7. For the output see current window/ Figure window
8. Stop the Program.

THEORY:
In the 5G NR downlink frame, SS blocks are transmitted towards UEs at regular
intervals based on periodicity set (i.e. 5/10/20/40/80/160 ms). Multiple SS blocks
are carried in a SS burst. A single SS block spans 4 OFDM symbols on time axis
and 240 subcarriers on frequency axis. SS block carry PSS (Primary
Synchronization Signal), SSS (Secondary Synchronization Signal) and PBCH
with DMRS. The SS blocks are grouped into first 5 ms of the SS burst. The
maximum number (L) of SS blocks in single burst is frequency dependant. There
can be about 64 blocks per burst at frequencies above 6 GHz (i.e.mmwave
frequencies). Following are the possible candidate SSB locations (L) within SS
Burst set.
• L =4 for Up to 3 GHz
• L = 8 from 3 GHz to 6 GHz

• L = 64 from 6 GHz to 52.6 GHz


Here DMRS (Demodulation Reference Signal) associated with PBCH channel is
used to estimate RSRP (Reference signal received power) is calculated from the
received SS blocks at the UE.
In 5G NR system SS blocks are transmitted
using directional beams unlike LTE. In LTE, downlink frame is transmitted
omnidirectionally which carries PSS and SSS signals. UE is aware of their
location in control channel.
SS block contains are as follows.
• 1 Symbol PSS
• 1 Symbol SSS
• 2 Symbols PBCH
• Each SS Bursts carry one or multiple SS blocks.
• SS Burst set consists of one or multiple SS bursts.
• Transmission is periodic (20 ms by default).
• The transmission of SSBs within SS burst set is confined within a 5 ms window.
In 5G NR, SSBs are used for cell search and initial synchronization. SSBs are transmitted
within SSBbursts,andtheycarryspecificsynchronizationsignals.ModelingSSBsandBursts
involvesgeneratingandprocessingthesesignals.
CODING:

% Set simulation parameters


numSsb = 4; % Number of SSBs in a burst
ssbLength = 127; % Length of each SSB
numBursts = 10; % Number of bursts
snr = 20; % Signal-to-noise ratio in dB
% Generate random SSBs
ssbs = randi([0, 1], numSsb * ssbLength * numBursts, 1);
% Transmit SSBs (simulated channel with noise)
receivedSSBs = awgn(ssbs, snr, 'measured');
% Extract SSBs from received signal
extractedSSBs = reshape(receivedSSBs, ssbLength, numSsb * numBursts);
% Perform processing on each SSB
for i = 1:numSsb * numBursts
% Process each SSB here (e.g., synchronization and decoding)
% This is a placeholder for actual processing
end
% Display results (for illustration)
disp('SSB Processing Results:');
for i = 1:numSsb * numBursts
disp(['SSB ' num2str(i) ' processed']);
end
OUTPUT:
RESULT:

The program will display generated SSB bursts, received SSB bursts (possibly with

Channel effects),and decoded SSB information.


EXP:3 CHANNEL MODELLING IN 5G NETWORKS

AIM:
Develop a MATLAB program for channel modeling in 5G Networks.

APPARATUSREQUIRED:
Hardware: Personal computer
Software : MATLAB, 5GToolbox, knowledge of 5G NR standard.

PROCEDURE:
1. Start the MATLAB 2023a
2. Open M file
3. Type the program
4. Save in the current Directory
5. Compile and Run the Program
6. If any error occurs in the program correct and run it again
7. For the output see current window/ Figure window
8. Stop the Program.

THEORY:
In 5G Networks, channel modeling involves simulating wireless communication
channel between a transmitter and receiver. This simulation accounts for various factors such
as path loss, fading, delay spread, and channel characteristics at different frequency bands
and scenarios(e.g.,urban,rural,indoor).

A channel model is a mathematical representation of the effects of a communication


channel through which wireless signals are propagated. The channel model can represent the
power loss incurred by the signal as it travels through the wireless medium. In a more general
case, the channel model is the impulse response of the channel medium in the time domain or
its Fourier transform in the frequency domain. The channel impulse response of a wireless
communication system typically varies randomly over time.
Channel Modelling in 5G
Furthermore, 5G systems should be adapted to a wide range of scenarios, such as
indoor, urban, suburban, rural area, etc. All the above-mentioned technologies set
new requirements for 5G channel modeling, which are summarized as follows:

1) Wide Frequency Range: A new 5G channel model should support a wide


frequency range, e.g., 350 MHz to 100 GHz. The model at higher frequency bands,
e.g., above 6 GHz, should maintain compatibility with the model at lower
frequency bands, e.g., below 6 GHz.
2) Broad Bandwidths: A new 5G channel model should have the ability to support
large channel bandwidths, e.g., 500 MHz to 4 GHz.
3) Wide Range of Scenarios: A new 5G channel model should be able to support a
wide range of scenarios such as indoor, urban, suburban, rural area, high-speed
train (HST) scenarios, etc.
4) Double-Directional Three-Dimensional (3D) Modeling: A new 5G channel
model should provide full 3D modeling, including accurate 3D antenna modeling
and 3D propagation modeling.
5) Smooth Time Evolution: A new 5G channel model has to evolve smoothly over
time, involving parameters drifting and cluster fading in and fading out, which are
important to support mobility and beam tracking for 5G communications.
6) Spatial Consistency: Spatial consistency means two closely located transmitters
or receivers should have similar channel characteristics. Channel states including
largescale parameters (LSPs), small-scale parameters (SSPs), line-of-sight/non
line-of-sight (LoS/NLoS) condition, and indoor/outdoor state should vary in a
continuous and realistic manner as a function of position.
7) Frequency Dependency and Frequency Consistency: The parameters and
statistics of a new 5G channel model should vary smoothly with the frequency.
Channel parameters and statistics at adjacent frequencies should have strong
correlations.
8) Massive MIMO: A new 5G channel model must support massive MIMO, i.e.,
spherical wavefront and array non-stationarity have to be properly modeled. —
Spherical wavefront: In massive MIMO systems, the distance between the
transceiver and cluster could be less than the Rayleigh distance. Therefore,
spherical wavefront instead of plane wavefront must be considered. — Array non-
stationarity: Array non-stationarity refers to the fact that clusters may appear or
disappear from the viewpoint of one antenna element to the next one, which means
different antenna elements could see different cluster sets. It also means
parameters, such as power and delay drift, over different antenna elements.
9) Direct D2D/V2V: In D2D/V2V scenarios, both the transmitter and receiver are
equipped with lower antennas and may interact with a large number of scatterers.
D2D/V2V channel models have to take into account the mobility of both ends,
which significantly increases the modeling complexity. The relative speed between
the two ends and fast-changing environments introduce extra Doppler frequency
shift and result in serious non-stationary channels. All of these make the D2D/V2V
channels differ greatly from conventional cellular channels.
10) High Mobility: A new 5G channel model should support high mobility
scenarios, such as HST scenario with the speed of the train even over 500 km/h.
The model should be able to capture certain characteristics of high mobility
channels, such as large Doppler frequency and non-stationarity. Furthermore, the
channel model has to work reliably in various HST scenarios, including open
space, viaduct, cutting, hilly terrain, tunnel, station scenarios, etc
CODING:

% 5G Channel Modeling
% Set simulation parameters
numSamples = 1000; % Number of samples
numTxAnts = 2; % Number of transmit antennas
numRxAnts = 2; % Number of receive antennas
carrierFreq = 3.5e9; % Carrier frequency in Hz (3.5 GHz)
sampRate = 15.36e6; % Sampling rate in Hz (15.36 MHz)
% Create a 5G NR channel configuration
channel = nrTDLChannel;
channel.NumTransmitAntennas = numTxAnts;
channel.NumReceiveAntennas = numRxAnts;
channel.DelayProfile = 'CDL-D';
channel.DelaySpread = 30e-9;
channel.CarrierFrequency = carrierFreq;
channel.SampleRate = sampRate;
channel.NormalizePathGains = true;
% Generate random QPSK symbols
data = randi([0, 3], numSamples, numTxAnts);
% Modulate the symbols using QPSK modulation
modulatedData = qammod(data, 4, 'UnitAveragePower', true);
% Pass the modulated signal through the channel
channelOutput = channel(modulatedData);
% Calculate the received signal power per receive antenna
rxPowerPerAntenna = sum(abs(channelOutput).^2) / numSamples;
% Display received power for each antenna
disp('Received Power per Antenna:');
disp(rxPowerPerAntenna);
% Plot the channel impulse response for the first receive antenna figure;
plot(0:numSamples-1, abs(channelOutput(:, 1)));
title('Channel Impulse Response (First Receive Antenna)');
xlabel('Sample Index');
ylabel('Magnitude');
% Plot the frequency response for the first receive antenna figure;
freqz(channelOutput(:, 1));
title('Channel Frequency Response (First Receive Antenna)');

OUTPUT:

channelmodelling
Received Power per Antenna:
1.3151 1.1736
RESULT:
The program will display channel characteristics, including delay spread, Doppler spread,
and SNR, forthe selected 5G channel model andscenario.
EXP 4 : MULTIBAND OFDM DEMODULATION

AIM:
Develop a MATLAB program for Multiband OFDM (MB-OFDM) demodulation.

APPARATUSREQUIRED:
Hardware: Personal computer
Software : MATLAB, 5GToolbox, knowledge of 5G NRstandard.

PROCEDURE:
1. Start the MATLAB 2023a
2. Open M file
3. Type the program
4. Save in the current Directory
5. Compile and Run the Program
6. If any error occurs in the program correct and run it again
7. For the output see current window/ Figure window
8. Stop the Program.

THEORY:

Single-band radio that occupies the whole allocated spectrum in favor of Multi-
band design approach Multi-banding consists in dividing the available spectrum
into several sub-bands. By interleaving symbols across different sub-bands, UWB
system can still maintain the same transmit power as if it was using the entire
bandwidth.

The main difference between the multi-band OFDM system and other narrowband
OFDM systems is the way that different sub-bands are used in the system. The
transmission is not done continually on all sub-bands. Rather, it is time
multiplexed between different bands in order to use a single hardware for
communications over different sub-bands.
OFDM system except that the carrier frequency changes from symbol to symbol
according to a sub-band hopping scheme. The convolutional code with interleaving
is used to combat multipath fading. The main idea of the MB-OFDM is that the
high rate serial data stream is converted into the N parallel low rate data stream in
order to combat the frequency selective fading prevent inter-carrier-interference
(ICI) while avoiding adopting the complex MIMO-EQ at the receiver.

The OFDM modulation is performed by an inverse fast Fourier transform (IFFT)


and a cyclic prefix (CP) is added to cancel inter-block interference (IBI) and inert-
channel interference (ICI). A guard interval of silence is also added to allow the
transmitter and receiver to switch from one sub-band to another. The signal is then
is fed into a D/A converter and sent to the RF section. At the receiver the signal is
sampled after down conversion and filtering. Demodulation is performed using a
fast Fourier transform (FFT) followed by one-tap frequency domain equalization
and decision

MB-OFDMdemodulationinvolvesseveralkeysteps,includingsynchronization,symbol
extraction, and decoding. In this example, we will focus on the basicstepsinvolvedin
demodulatingMB-OFDMsignals.

Multi-Band Orthogonal Frequency Division Multiplexing (MB-OFDM) is a variation of


OFDM that divides the available spectrum into multiple subbands. Each subband is treated as
a separate OFDM system, and the data is transmitted simultaneously over all subbands.
Demodulating MB-OFDM signals typically involves processing each subband separately.

In this code:

1. We generate random QPSK symbols for each subband and add AWGN to simulate
noisy transmission.

2. Demodulation of each subband is performed using the demodulate_OFDM function.


You should replace this function with your specific demodulation implementation, which
typically involves steps like removing the cyclic prefix, performing FFT, and decoding.

3. The demodulated bits are stored in the rx_bits cell array, where each element
corresponds to a subband.

4. You can further process and combine the demodulated bits from different subbands
based on your system requirements
CODING:

% Set simulation parameters


numSubcarriers = 64; % Number of subcarriers
numSymbols = 10; % Number of OFDM symbols
numGuard = 6; % Number of guard subcarriers
cpLength = 16; % Cyclic prefix length
channelDelay = 3; % Channel delay in samples
snrdB = 20; % Signal-to-noise ratio in dB
% Generate BPSK symbols
txData = randi([0, 1], numSubcarriers * numSymbols, 1);
modulatedData = 2 * txData - 1;
% Reshape modulated data into subcarriers
dataMatrix = reshape(modulatedData, numSubcarriers, numSymbols);
% Perform IFFT on each subcarrier
timeDomainData = ifft(dataMatrix, numSubcarriers);
% Add cyclic prefix
cyclicPrefix = timeDomainData(end - cpLength + 1:end, :);
timeDomainDataWithCP = [cyclicPrefix; timeDomainData];
% Transmit the time-domain signal through a channel (simulated with delay and noise)
channelOutput = [zeros(channelDelay, numSymbols); timeDomainDataWithCP];
rxSignal = channelOutput + (randn(size(channelOutput)) + 1i *
randn(size(channelOutput))) / sqrt(2) * 10^(-snrdB / 20);
% Remove cyclic prefix
rxSignalNoCP = rxSignal(cpLength + 1:end, :);
% Perform FFT on each subcarrier
freqDomainData = fft(rxSignalNoCP, numSubcarriers);
% Demodulate BPSK symbols
demodulatedData = real(freqDomainData(:)) > 0; % BPSK demodulation
% Calculate bit error rate (BER)
ber = sum(txData ~= demodulatedData) / (numSubcarriers * numSymbols);
% Display results
disp(['Bit Error Rate (BER): ' num2str(ber)]);
disp(['Number of Errors: ' num2str(sum(txData ~= demodulatedData))]);
OUTPUT:

ofdmdemodulation
Bit Error Rate (BER): 0.50156
Number of Errors: 321

RESULT:
The program will display the demodulated and decoded data and provide

performancemetricssuch astheBit Error Rate (BER) and Number of


errors in Demodulated data.
EXP 5: PERFECT CHANNEL ESTIMATION EXAMPLE FOR OFDM
(BPSKMODULATION)

AIM:
To develop a MATLAB program for perfect channel estimation in an OFDM system
using BPSK modulation.
APPARATUSREQUIRED:
Hardware: Personal computer
software :MATLAB , 5GToolbox, knowledge of 5G NR standard.
PROCEDURE:
1. Start the MATLAB 2023a
2. Open M file
3. Type the program
4. Save in the current Directory
5. Compile and Run the Program
6. If any error occurs in the program correct and run it again
7. For the output see current window/ Figure window
8. Stop the Program.

THEORY:
Channel estimation is an important technique especially in mobile wireless
network systems where the wireless channel changes over time, usually caused by
transmitter and/or receiver being in motion at vehicular speed.
Mobile wirelesscommunication is adversely affected by the multipath interference
resulting fromreflections from surroundings, such as hills, buildings and other obstacles.
In orderto provide reliability and high data rates at the receiver, the system needs an
accurate estimate of the time-varying channel.
Furthermore, mobile wirelesssystems are one of the main technologies which used to
provide services such asdata communication, voice, and video with quality of service
(QoS) for bothmobile users and nomadic.
The knowledge of the impulse response of mobile
wireless propagation channels in the estimator is an aid in acquiring important
information for testing, designing or planning wireless communication systems.
Channel estimation is based on the training sequence of bits and which is unique
for a certain transmitter and which is repeated in every transmitted burst .The
channel estimator gives the knowledge on the channel impulse response (CIR) to
the detector and it estimates separately the CIR for each burst by exploiting
transmitted bits and corresponding received bits. Signal detectors must have
knowledge concerning the channel impulse response (CIR) of the radio link with
known transmitted sequences, which can be done by a separate channel estimator.
The modulated corrupted signal from the channel has to be undergoing the channel
estimation using LMS, MLSE, MMSE, RMS etc before the demodulation takes
place at the receiver side.
InanOFDMsystem,perfectchannelestimationinvolvesaccuratelyestimatingthefrequency
response of the channel at each subcarrier. This estimation is essential for equalization
anddemodulationatthereceiver.Typically,pilotsymbolsareinsertedintothetransmittedsignal,
andtheseknownsymbolsare used forchannel estimation.

1. Parameters like the SNR (Signal-to-Noise Ratio), number of symbols, symbol rate,
modulation order, and Eb/No (Energy per bit to Noise power spectral density ratio) are
defined.

2. Random binary data is generated for transmission.

3. The data is modulated using BPSK modulation (pskmod function).

4. A perfect channel represented by H is assumed, where H is a complex fading gain


with a magnitude of 1 and a random phase.

5. Complex Gaussian noise is added to the received signal to simulate the effect of noise.

6. The received signal is demodulated using BPSK demodulation (pskdemod function).

7. The bit error rate (BER) is calculated by comparing the transmitted and received data
bits.
CODING:

% Set simulation parameters


numSubcarriers = 64; % Number of subcarriers
numSymbols = 10; % Number of OFDM symbols
cpLength = 16; % Cyclic prefix length
snrdB = 20; % Signal-to-noise ratio in dB
% Generate BPSK symbols
txData = randi([0, 1], numSubcarriers * numSymbols, 1);
modulatedData = 2 * txData - 1;
% Reshape modulated data into subcarriers
dataMatrix = reshape(modulatedData, numSubcarriers, numSymbols);
% Perform IFFT on each subcarrier
timeDomainData = ifft(dataMatrix, numSubcarriers);
% Add cyclic prefix
cyclicPrefix = timeDomainData(end - cpLength + 1:end, :);
timeDomainDataWithCP = [cyclicPrefix; timeDomainData];
% Transmit the time-domain signal through a channel (simulated with delay and noise)
rxSignal = timeDomainDataWithCP + (randn(size(timeDomainDataWithCP)) + 1i *
randn(size(timeDomainDataWithCP))) / sqrt(2) * 10^(-snrdB / 20);
% Remove cyclic prefix
rxSignalNoCP = rxSignal(cpLength + 1:end, :);
% Perform FFT on each subcarrier
freqDomainData = fft(rxSignalNoCP, numSubcarriers);
% Estimate the channel using known pilot symbols (e.g., in 5G Synchronization Signals)
pilotIndexes = [7, 21, 43, 57];
pilotSymbols = freqDomainData(pilotIndexes, :);
% Perform channel estimation (simplified: assume known pilot symbols and linear
interpolation)
channelEstimates = interp1(pilotIndexes, pilotSymbols, 1:numSubcarriers, 'linear', 'extrap');
% Demodulate BPSK symbols using channel estimates
estimatedSymbols = real(channelEstimates) > 0; % BPSK demodulation
% Calculate bit error rate (BER)
ber = sum(txData ~= estimatedSymbols(:)) / (numSubcarriers * numSymbols);
% Display results
disp(['Bit Error Rate (BER): ' num2str(ber)]);
disp(['Number of Errors: ' num2str(sum(txData ~= estimatedSymbols(:)))]);

OUTPUT:
channelestimation
Bit Error Rate (BER): 0.48594
Number of Errors: 311

RESULT:
The program will display two plots showing the estimated channel's magnitude and
phase responses. These plots provide in sights in to the frequency-selective fading
characteristics of the channel.
EXP 6: DEVELOPMENT OF 5G NEW RADIO POLAR CODING &
DECODING

AIM: Develop a MATLAB program for 5G NR Polar Coding and Decoding.


APPARATUSREQUIRED:
Hardware: Personal computer

Software: MATLAB software, 5GTool box, knowledge of polar codes and the 5G NR
standard.
PROCEDURE:
1. Start the MATLAB 2023a
2. Open M file
3. Type the program
4. Save in the current Directory
5. Compile and Run the Program
6. If any error occurs in the program correct and run it again
7. For the output see current window/ Figure window
Stop the Program
THEORY:
Polar codes are error-correcting codes used in the control channels of the 5G NR standard.
Polar coding involves two main processes: encoding and decoding.

Define your Polar codes: Define the length of your codeword, code rate, and the
construction type for Polar codes. In 5G NR, various code lengths and rates are used for
different control and data channels. You can use the MATLAB Communications System
Toolbox for encoding and decoding Polar codes.

Polar Encoder: Use the comm.PolarEncoder object in MATLAB to create a Polar


encoder for your specified parameters. Here's an example of how you can create a Polar
encoder:

encode your message: Generate your message bits and encode them using the Polar
encoder you created.

Polar Decoder: Create a Polar decoder to decode the received bits. You can use the
comm.PolarDecoder object in MATLAB:

Simulate the Channel: Simulate the transmission through a binary symmetric channel
(BSC) or any other channel model you prefer. The channel introduces errors into the
received bits.

Decode the received bits: Decode the received bits using the Polar decoder:

Evaluate the Performance: Calculate the bit error rate (BER) or any other performance
metrics to assess the effectiveness of your Polar coding implementation.

The selection of polar codes as the channel coding technique for control channels

for 5G NR communications systems. Based on the concept of channel

polarization, this new coding family is capacity achieving as opposed to just

capacity approaching. With better or comparable performance than LDPC and

turbo codes, it supersedes the tail-biting convolutional codes used in LTE systems

for control channels. It is applied for downlink and uplink control information

(DCI/UCI) for the enhanced mobile broadband (eMBB) use case, as well as the

broadcast channel (BCH). Alternatively, the channel coding scheme for data

channels for eMBBis specified to be flexible LDPC for all block sizes.

3GPP has selected polar codes as the error correcting code on the 5G NR

control channels. Polar codes are unique in the way they split the channel

into good and bad bit-channels.

Consider a polar code where K information bits are being sent in a block

of N bits. Polar code encoding will polarize the channel into reliable and

unreliable bit-channels. The information bits will be transmitted on the most

reliable K bit-channels. The remaining N-K channels are unreliable are usually

set to 0 as they are not reliable for data transmission.


CODING:

POLARCODEENCODING:

s = rng(100); % Seed the RNG for repeatability


%Specify the code parameters used for a simulation.
% Code parameters
K = 54; % Message length in bits, including CRC, K > 30
E = 124; % Rate matched output length, E <= 8192
EbNo = 0.8; % EbNo in dB
L = 8; % List length, a power of two, [1 2 4 8]
numFrames = 10; % Number of frames to simulate
linkDir = 'DL'; % Link direction: downlink ('DL') OR uplink ('UL')
if strcmpi(linkDir,'DL')
% Downlink scenario (K >= 36, including CRC bits)
crcLen = 24; % Number of CRC bits for DL, Section 5.1, [6]
poly = '24C'; % CRC polynomial
nPC = 0; % Number of parity check bits, Section 5.3.1.2, [6]
nMax = 9; % Maximum value of n, for 2^n, Section 7.3.3, [6]
iIL = true; % Interleave input, Section 5.3.1.1, [6]
iBIL = false; % Interleave coded bits, Section 5.4.1.3, [6]
else
% Uplink scenario (K > 30, including CRC bits)
crcLen = 11;
poly = '11';
nPC = 0;
nMax = 10;
iIL = false;
iBIL = true;
end
%Polar Encoding
R = K/E; % Effective code rate
bps = 2; % bits per symbol, 1 for BPSK, 2 for QPSK
EsNo = EbNo + 10*log10(bps);
snrdB = EsNo + 10*log10(R); % in dB
noiseVar = 1./(10.^(snrdB/10));

% Channel
chan = comm.AWGNChannel('NoiseMethod','Variance','Variance',noiseVar);
%polor decoding
% Error meter
ber = comm.ErrorRate;
numferr = 0;
for i = 1:numFrames

% Generate a random message


msg = randi([0 1],K-crcLen,1);

% Attach CRC
msgcrc = nrCRCEncode(msg,poly);

% Polar encode
encOut = nrPolarEncode(msgcrc,E,nMax,iIL);
N = length(encOut);

% Rate match
modIn = nrRateMatchPolar(encOut,K,E,iBIL);

% Modulate
modOut = nrSymbolModulate(modIn,'QPSK');

% Add White Gaussian noise


rSig = chan(modOut);
% Soft demodulate
rxLLR = nrSymbolDemodulate(rSig,'QPSK',noiseVar);

% Rate recover
decIn = nrRateRecoverPolar(rxLLR,K,N,iBIL);

% Polar decode
decBits = nrPolarDecode(decIn,K,E,L,nMax,iIL,crcLen);

% Compare msg and decoded bits


errStats = ber(double(decBits(1:K-crcLen)), msg);
numferr = numferr + any(decBits(1:K-crcLen)~=msg);

end
disp(['Block Error Rate: ' num2str(numferr/numFrames) ...
', Bit Error Rate: ' num2str(errStats(1)) ...
', at SNR = ' num2str(snrdB) ' dB'])

rng(s); % Restore RNG


OUTPUT:
>> polarcoding1
Block Error Rate: 0, Bit Error Rate: 0, at SNR = 0.20002 dB

RESULT:

The program will display the encoded bits, received bits (with noise), decoded

bits, and the Bit Error Rate (BER) after decoding.

You might also like