Wireless Communication Lab Manual Corrected Program (1)
Wireless Communication Lab Manual Corrected Program (1)
NAME :
REGISTER NUMBER :
SECTION :
Vision of the Department
PEO2: Communication and Laboratory Skills: To train the students with good
practical exposure by using modern equipped laboratories and to exhibit good
communication skills.
PO2 : 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.
PO3 : 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.
PO4 : Conduct investigations of complex problems: Use research based knowledge and research
methods including design of experiments in analyzing and interpreting data, and synthesizes the
data to come to valid conclusion.
PO5 : Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling of complex engineering activities with
an understanding of the limitations.
PO6 : 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.
PO7 : Environment and sustainability: Understand and correctly interpret the impact of engineering
solutions in global, societal and environmental contexts and demonstrate the knowledge of a need
for sustainable development.
PO8 : Ethics: Understand ethics of life and professions and abide by them. Proficiency in
multidisciplinary domains for devising the solution of real time problems, ability to work with
national and international organizations and to understand the impact of engineering solutions.
PO9 : Individuals and Teamwork: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
PO10: Communications: 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.
PO11: Project management and finance: Demonstrate knowledge and understanding of the engineering
and 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.
PO12: Lifelong 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.
SYLLABUS
OBJECTIVES: The student should be made to:
LIST OF EXPERIMENTS:
1. Modeling of wireless communication systems using Matlab(Two ray channel and Okumura –Hata
model)
2. Modeling and simulation of Multipath fading channel
3. Design, analyze and test Wireless standards and evaluate the performance measurements such as BER,
PER, BLER, throughput, capacity, ACLR, EVM for 4G and 5G using Matlab
4. Modulation: Spread Spectrum – DSSS Modulation & Demodulation
5. Wireless Channel equalization: Zero-Forcing Equalizer (ZFE),MMSE Equalizer(MMSEE),Adaptive
Equalizer (ADE),Decision Feedback Equalizer (DFE)
6. Modeling and simulation of TDMA, FDMA and CDMA for wireless communication
OUTCOMES: At the end of the course, the student should be able to:
Apply the cellular concepts to improve the Coverage And Capacity In Cellular Systems.
Understand the basic Radiation mechanisms to reduce the path loss and fading effect in mobile
radio propagation
Apply the digital modulation techniques In Fading And Multipath Channels to improve the Bit
Error Rate
Analyze 4G and 5G wireless standards for system performance using the channel parameters
Investigate a cellular system based on resource availability and traffic demands to optimize the
use of the channel capacity in telecommunication networks
INDEX
Page
Sl.No. Name of the Experiment
No.
CYCLE 1 - EXPERIMENTS
CYCLE 2 - EXPERIMENTS
%Program
Modeling Wireless Communication System with Two-Ray Ground Reflection and
Okumura-Hata Model
% Parameters
frequency = 900e6; % Carrier frequency in Hz (e.g., 900 MHz)
distance = linspace(1, 1000, 100); % Distance between transmitter and receiver in meters
heightTx = 50; % Height of the transmitter in meters
heightRx = 1.5; % Height of the receiver in meters
txPower = 20; % Transmitter power in dBm
RESULT:
Thus the SCILAB programs for Modeling of wireless communication (Two ray channel
and Okumura –Hata model) was written and the results were plotted.
PROCEDURE:
1. Start the SCILAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window 8. Stop the program.
To Model and simulate of Multipath fading channel using SCI LAB
%Program
*Model and simulate of Multipath fading channel*
clear
f_c=1e3;%carrier frequency(no modulation)
time_1 = (linspace (0, 10, 1000));%time
signal_in = sin (2 * pi *f_c* time_1);%sine wave
plot (time_1,(signal_out),'r')%red=signal_out
pause (2)%~ seconds
end
hold off
OUTPUT( To Model and simulate of Multipath fading channel using SCI LAB)
RESULT:
Thus the SCILAB programs To Model and simulate of Multipath fading channel using
SCI LAB function written and the results were plotted.
PROCEDURE:
1. Start the SCILAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window 8. Stop the program.
To Model and simulate of Multipath fading channel using SCI LAB
%Program
* To Design, analyze and test Wireless standards and evaluate the performance
measurements such as BER, PER, BLER, throughput, capacity, ACLR, EVM for
4G and 5G using SCI LAB *
% Parameters
numBits = 1e6; % Number of bits to transmit
EbNo_dB = 0:2:20; % Eb/No in dB (varying SNR values)
SNR_dB = EbNo_dB + 10*log10(1); % Convert Eb/No to SNR in dB
SNR = 10.^(SNR_dB/10); % Convert SNR from dB to linear scale
% BPSK Modulation
modulatedSignal = 2 * dataBits - 1; % Map 0s to -1 and 1s to +1
% BER Simulation
ber = zeros(size(SNR));
for i = 1:length(SNR)
% AWGN Channel
noisePower = 1 / SNR(i); % Calculate noise power based on SNR
noise = sqrt(noisePower) * randn(1, numBits); % Generate Gaussian noise
receivedSignal = modulatedSignal + noise;
% BPSK Demodulation
receivedDataBits = receivedSignal > 0;
% Bit Error Rate (BER) Calculation
numErrors = sum(dataBits ~= receivedDataBits);
ber(i) = numErrors / numBits;
end
RESULT:
Thus the SCILAB programs To Design, analyze and test Wireless standards and evaluate
the performance measurements such as BER, PER, BLER, throughput, capacity, ACLR,
EVM for 4G and 5G using SCI LAB written and the results were plotted.
PROCEDURE:
1. Start the SCILAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window 8. Stop the program.
To Model and simulate of Multipath fading channel using SCI LAB
%Program
* To analyze and design Zero-Forcing Equalizer (ZFE),MMSE
Equalizer(MMSEE),Adaptive Equalizer (ADE),Decision Feedback Equalizer (DFE)
using a SCI lab ..*
%% Input initialization
clc
close all
clear all
if j == 1
[mod,demod] = fsk();
type = ' FSK ';
elseif j== 2
[mod,demod] = bpsk();
type = ' BPSK ';
else
[mod,demod] = qpsk();
type = ' QPSK ';
end
s = step(mod,ip);
Eb_N0_dB = [-3:35]; % multiple Eb/N0 values
% equalization
yHat = y./h;
%yHat = equ(y);
op = step(demod,yHat);
end
%% BER CALCULATION
%% Figures
% plot
figure(j)
%semilogy(Eb_N0_dB,theoryBerAWGN,'cd-','LineWidth',2);
hold on
semilogy(Eb_N0_dB,theoryBer,'bp-','LineWidth',2);
semilogy(Eb_N0_dB,simBer,'mx-','LineWidth',2);
axis([-3 35 10^-5 0.5])
grid on
legend('Rayleigh-Theory', 'Rayleigh-Simulation');
xlabel('Eb/No, dB');
ylabel('Bit Error Rate');
head = strcat('BER for',type,'modulation in Rayleigh channel using Zero Forcing' );
title(head);
%figure()
%plot(op)
end
%% Function setup
%{
% for BPSK
function [mod,demod] = bpsk()
mod = comm.BPSKModulator();
demod = comm.BPSKDemodulator();
end
% for fsk
function [mod,demod] = fsk()
mod = comm.FSKModulator();
demod = comm.FSKDemodulator();
end
% for qpsk
% Parameters
numTapsFeedforward = 5; % Number of feedforward filter taps
numTapsFeedback = 3; % Number of feedback filter taps
mu = 0.01; % Step size (adjust as per convergence and stability)
% DFE Equalization
equalizedSignal = zeros(size(receivedSignal));
for n = max(numTapsFeedforward, numTapsFeedback) + 1:length(receivedSignal)
% Feedforward filter operation
feedforwardInput = receivedSignal(n:-1:n-numTapsFeedforward+1);
feedforwardOutput = feedforwardCoefficients * feedforwardInput.';
M = 4; % QPSK
numSymbols = 10000;
numTrainingSymbols = 1000;
chtaps = [1 0.5*exp(1i*pi/6) 0.1*exp(-1i*pi/8)];
EbN0 = 20;
data = randi([0 M-1], numSymbols, 1);
tx = pskmod(data, M, pi/4);
rx = awgn(filter(chtaps,1,tx),25,'measured');
eq =
comm.LinearEqualizer('Algorithm','CMA','AdaptWeights',false,'InitialWeightsSource','Pr
operty')
wgts = mmseweights(eq,chtaps,EbN0)
eq.InitialWeights = wgts;
[y,err,weights] = eq(rx);
constell = comm.ConstellationDiagram('NumInputPorts',2);
constell(rx,y)
plot(abs(err))
grid on; xlabel('Symbols'); ylabel('|e|')
errevm = comm.EVM;
evm = errevm(tx,y)
subplot(3,1,1); stem(real(weights)); ylabel('real(weights)'); xlabel('Tap'); grid on; axis([1
8 -0.5 1])
line([eq.NumTaps+0.5 eq.NumTaps+0.5], [-0.5 1], 'Color', 'r', 'LineWidth', 1)
title('Equalizer Tap Weights')
subplot(3,1,2); stem(imag(weights)); ylabel('imag(weights)'); xlabel('Tap'); grid on;
axis([1 8 -0.5 1])
line([eq.NumTaps+0.5 eq.NumTaps+0.5], [-0.5 1], 'Color', 'r', 'LineWidth', 1)
subplot(3,1,3); stem(abs(weights)); ylabel('abs(weights)'); xlabel('Tap'); grid on; axis([1 8
-0.5 1])
line([eq.NumTaps+0.5 eq.NumTaps+0.5], [-0.5 1], 'Color', 'r', 'LineWidth', 1)
OUTPUT (To analyze and design Zero-Forcing Equalizer (ZFE),MMSE
Equalizer(MMSEE),Adaptive Equalizer (ADE),Decision Feedback Equalizer (DFE)
using a SCI lab .
RESULT:
Thus the SCI lab code to analyze and design Zero-Forcing Equalizer
(ZFE),MMSE Equalizer(MMSEE),Adaptive Equalizer (ADE),Decision Feedback
Equalizer (DFE) was written and the results were plotted.
Ex. No: 6 Date:
AIM:
To model and simulate of TDMA, FDMA and CDMA for wireless
communication using SCI lab.
HARDWARE : Personal Computer
SOFTWARE : SCILAB
PROCEDURE:
1. Start the SCILAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window 8. Stop the program.
To Model and simulate of Multipath fading channel using SCI LAB
%Program
* To model and simulate of TDMA, FDMA and CDMA for wireless communication
using SCI lab % CDMA Multiplexing Simulation
clear; clc;
% Parameters
fs = 1000; % Sampling frequency (in Hz)
T = 1; % Duration of simulation (in seconds)
num_users = 3; % Number of users
% Generate user signals
t = 0:1/fs:T-1/fs; % Time vector
% User 1
user1_data = randi([0, 1], 1, length(t)); % Generate random data
user1_signal = 2 * user1_data - 1; % BPSK modulation (0 -> -1, 1 -> 1)
% User 2
user2_data = randi([0, 1], 1, length(t)); % Generate random data
user2_signal = 2 * user2_data - 1; % BPSK modulation (0 -> -1, 1 -> 1)
% User 3
user3_data = randi([0, 1], 1, length(t)); % Generate random data
user3_signal = 2 * user3_data - 1; % BPSK modulation (0 -> -1, 1 -> 1)
% Integrate and dump (accumulate and average) to get the original data
integrated_user1_data = sum(reshape(demod_user1_signal, [], length(user1_data)), 1) /
spread_code_len;
integrated_user2_data = sum(reshape(demod_user2_signal, [], length(user2_data)), 1) /
spread_code_len;
integrated_user3_data = sum(reshape(demod_user3_signal, [], length(user3_data)), 1) /
spread_code_len;
subplot(4, 1, 2);
plot(t, user2_signal);
title('User 2 Signal');
subplot(4, 1, 3);
plot(t, user3_signal);
title('User 3 Signal');
subplot(4, 1, 4);
plot(t, cdma_signal);
title('CDMA Multiplexed Signal');
sgtitle('CDMA Multiplexing Simulation');
samples=1000;
% number of users
nos=8;
% modulating signal frequency in Hz
mfreq=[30 40 50 60 70 80 90 100];
% carrier frequency allocated to the different users in Hz
cfreq=[300 600 900 12000 1500 1800 2100 2400];
ch_op=awgn(sum(y),0,'measured');
% display the transmitted signal and received signal at the base station
% figure
% Visualization
figure;
subplot(4,1,1);
plot(t, signal1);
title('Signal 1 (10 Hz)');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(4,1,2);
plot(t, signal2);
title('Signal 2 (20 Hz)');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(4,1,3);
plot(t, signal3);
title('Signal 3 (5 Hz)');
xlabel('Time (s)');
ylabel('Amplitude');
RESULT:
Thus the SCI lab code to To model and simulate of TDMA, FDMA and CDMA
for wireless communication using SCI lab.