CEC331 CN LAB
CEC331 CN LAB
ENGINEERING
Laboratory Record
Name :
Reg. No. :
LABORATORY RECORD
Name……………………………………………………………………………….
Register No………………………………Semester……………………………….
Branch………………………………………………………………………………
Certified that this is bonafide record of Work done by the above student
of the………………………………………………………………………………..
FACULTY IN-CHARGE
HEAD OF THE DEPARTMENT
1. OFDM, QAM, PSK waveform Configuration, Constellation diagram Using MATLAB 2023a APP.
TOTAL: 30 PERIODS
INDEX
Staff
S.No Date Name of the experiment Mark
Signature
Modeling of 5G Synchronization
2.
signal blocks and bursts
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
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.
5. Waveform Generation: Finally, the waveform is generated by combining the modulated
signal with the equalized signal.
Output:
RESULT:
CODING:
AIM:
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
• 1 Symbol PSS
• 1 Symbol SSS
• 2 Symbols PBCH
• Each SS Bursts carry one or multiple SS blocks.
% 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;
EXP No.:3 CHANNEL MODELLING IN 5G NETWORKS
Date:
AIM:
Develop a MATLAB program for channel modeling in 5G Networks.
APPARATUS REQUIRED:
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).
Channel modelling
Received Power per
Antenna: 1.3151 1.1736
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
RESULT:
CODING:
Date:
AIM:
Develop a MATLAB program for Multiband OFDM (MB-OFDM) demodulation.
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:
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
OUTPUT:
OFDM Demodulation
Bit Error Rate (BER): 0.50156
Number of Errors: 321
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
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
RESULT:
CODING:
AIM:
To develop a MATLAB program for perfect channel estimation in an OFDM 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.
In order to provide reliability and high data rates at the receiver, the system needs an
accurate estimate of the time-varying channel.
Furthermore, mobile wireless systems are one of the main technologies which used to
provide services such as data communication, voice, and video with quality of service (QoS)
for both mobile users and nomadic.
% 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(:)))]);
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.
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.
5. Complex Gaussian noise is added to the received signal to simulate the effect of noise.
7. The bit error rate (BER) is calculated by comparing the transmitted and received data
bits.
OUTPUT:
Channel estimation
Bit Error Rate (BER): 0.48594
Number of Errors: 311
RESULT:
CODING:
POLAR CODE ENCODING:
AIM:
Develop a MATLAB program for 5G NR Polar Coding and Decoding.
APPARATUSREQUIRED:
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.
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:
% Channel
chan = comm.AWGNChannel('NoiseMethod','Variance','Variance',noiseVar);
%polor decoding
% Error meter
ber = comm.ErrorRate;
numferr = 0;
for i = 1:numFrames
% 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');
% Rate recover
decIn = nrRateRecoverPolar(rxLLR,K,N,iBIL);
% Polar decode
decBits = nrPolarDecode(decIn,K,E,L,nMax,iIL,crcLen);
% Compare msg and decoded bits
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.
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) '
OUTPUT:
>> polarcoding1
Block Error Rate: 0, Bit Error Rate: 0, at SNR = 0.20002 dB
RESULT:
OFDM WAVEFORM.
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);
CONTENT BEYOND SYLLABUS
EXP NO: 7 5G Complaint waveform for OFDM, QAM and
PSK Date:
AIM:
Develop a MATLAB program to 5G Complaint waveform for OFDM,QAM and PSK.
APPARATUSREQUIRED:
Hardware: Personal computer
Software :MATLAB , 5GToolbox,knowledge of 5G NR standard.
PROCEDURE:
9. Start the MATLAB 2023a
10. Open M file
11. Type the program
12. Save in the current Directory
13. Compile and Run the Program
14. If any error occurs in the program correct and run it again
15. For the output see current window/ Figure window
16. Stop the Program.
OUTPUT:
QAM WAVEFORM:
%% 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 Coding:
RESULT: