Professional Documents
Culture Documents
Set 2 CNW Lab Expts 1-5
Set 2 CNW Lab Expts 1-5
(CE)
Laboratory Manual
Simulator: MATLAB
Schematic diagram’s:
n
Noise
Source
Noise
Source
1 𝑆𝑁𝑅
BER = { 1 − √ }
2 2+𝑆𝑁𝑅
% BER performance of AWGN and Rayleigh Fading System's for M-ary PSK
Modulation
%% Initialization
close all;
clear all;
clc;
rng('shuffle');
blockLength = 100; % # Symbols in a block of serial data
numBlocks = 10000; % # Iterations to get smooth BER curve
SNRdB = [1:0.5:12];
BER = zeros(size(SNRdB)); BER_fad = zeros(size(SNRdB)); %Initialization
of BER
SNR = zeros(size(SNRdB));
for L = 1: numBlocks
end
end
end
Procedure:
1. Type the MATLAB code in editor window.
2. Run the code and get the BER curves.
3. Calculate the BER for Various Modulation orders at a given SNR and tabulate the
results.
4. Compare theoretical and Simulated BER Curves for BPSK Modulation scheme.
Results:
5
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
S. SNR Modulation BER AWGN BER AWGN BER Fading BER Fading
no
(In dB) Type (Theoretical) (Simulated) (Theoretical) (Simulated)
1 9 BPSK
2 9 QPSK
3 10 BPSK
4 10 QPSK
5 12 BPSK
6 12 QPSK
Selected References:
1. NPTEL online course on Advanced 3G & 4G Wireless Communications by Prof. Aditya K.
Jagannatham (IIT Kanpur, EEE Dept.)
2. Aditya K. Jagannatham - Principles of Modern Wireless Communications Systems-MC GRAW
HILL INDIA (2015)
3. Wireless Communications Principles and practice by T S. Rappaport, Second edition.
6
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Simulator: MATLAB
Schematic diagram’s:
Binary M-ary x y
AWGN M-ary QAM Binary
Source QAM Channel De-Modulator Sink
Modulator
n
Noise
Source
Binary M-ary x y
Rayleigh Matched M-ary QAM
Source QAM Fading Binary
Filter De-Modulator
Modulator Channel Sink
Receiver
(h)
Noise
Source
7
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
2 1 3𝑛
BER = (1 − ) 𝑒𝑟𝑓𝑐(√ 𝑆𝑁𝑅 )
𝑛 √𝑀 𝑛2(𝑀−1)
1 𝑆𝑁𝑅
BER = { 1 − √ }
2 2+𝑆𝑁𝑅
%% Initialization
close all;
clear all;
clc;
rng('shuffle');
blockLength = 100; % # Symbols in a block of serial data
numBlocks = 10000; % # Iterations to get smooth BER curve
SNRdB = [1:0.5:12];
BER = zeros(size(SNRdB)); BER_fad = zeros(size(SNRdB)); %
Initialization of BER
SNR = zeros(size(SNRdB));
8
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
for L = 1:numBlocks
end
end
end
9
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Procedure:
1. Type the MATLAB code in editor window.
2. Run the code and get the BER curves.
3. Calculate the BER for Various Modulation orders at a given SNR and tabulate the
results.
4. Compare theoretical and Simulated BER Curves for BPSK Modulation scheme.
Results:
10
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
S. SNR Modulation BER AWGN BER AWGN BER Fading BER Fading
no
(In dB) Type (Theoretical) (Simulated) (Theoretical) (Simulated)
1 9 BQAM
2 9 4-QAM
3 10 BQAM
4 10 4-QAM
5 12 BQAM
6 12 4-QAM
Selected References:
1. NPTEL online course on Advanced 3G & 4G Wireless Communications by Prof. Aditya K.
Jagannatham (IIT Kanpur, EEE Dept.)
2. Aditya K. Jagannatham - Principles of Modern Wireless Communications Systems-MC GRAW
HILL INDIA (2015)
3. Wireless Communications Principles and practice by T S. Rappaport, Second edition.
11
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Simulator: MATLAB
Schematic diagram’s:
Noise
Serial to Parallel to
Information N-Point Cyclic
Parallel IFFT Serial
source prefix
Converter Converter
(Mapper) Addition
(De-MUX) (MUX)
12
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Theory:
OFDM is one of the types of multi carrier modulation technique, which converts a frequency
selective wide band channel into an orthogonal set of narrow band flat fading channel across each
subcarrier. OFDM is a key technology for 4G/5G wireless communications and Wi-Fi. OFDM replaces
the bank of modulators in traditional MCM system with Simple IFFT and FFT operations at transmitter
and Receiver respectively there by reducing implementational complexity. The Cyclic prefix acts as
guard interval between the two adjacent OFDM symbols, and usually its length must be greater than
delay spread of the channel to avoid inter OFDM symbol interference. Because of additional of cyclic
prefix, the effective throughput of the system decreases (because we are transmitting the tail samples
in OFDM symbol again) but the advantage is it converts the linear convolution action of channel into
circular convolution. Hence gives rise to circulant channel matrix ‘H’ which makes the system simpler
to analyze.
Mathematically we can express the OFDM system model as
y = cconv (h, x) + n
(or)
y = Hx + n
Where, x = Input vector to the channel
n = Additive White gaussian Noise vector
h = Fading channel coefficient vector
H = circulant channel matrix
y = Output vector received from the channel
cconv = Circular convolution
The Theoretical BER for the OFDM system with BPSK Constellation Mapper is Given as
1 𝑆𝑁𝑅_𝑒𝑓𝑓
BER = { 1 − √ }
2 2+𝑆𝑁𝑅_𝑒𝑓𝑓
L∗SNR
where, SNR_eff = Effective Signal to Noise Ratio =
Nsub
L = No. of channel Taps.
MATLAB Code:
% BER Performance of OFDM System for M-ary PSK Modulation with frequency
domain equalization at receiver
close all;
clear all;
clc;
rng('shuffle');
Nsub = 1024;
13
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Ncp = round(Nsub/10);
iter = 10000; % #Iterations
numTaps = 4; % # Channel Taps(# Coefficients)
SNRdB = [1:5:80];
SNR_effective = numTaps*SNR/Nsub;
BER_Theoretical = 0.5*(1-sqrt(SNR_effective./(2+SNR_effective))); %
Theoretical formula for OFDM...
... with BPSK mod at High SNR
semilogy(SNRdB,BER_Theoretical,'ro','linewidth',2.0); % Gives
Theoretical BER
14
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Procedure:
1. Type the MATLAB code in editor window.
2. Run the code and get the BER curves.
3. Calculate the BER for Various Modulation orders at a given SNR and tabulate the
results.
4. Compare theoretical and Simulated BER Curves for M- ary PSK Modulation
scheme.
Results:
15
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Selected References:
1. NPTEL online course on Advanced 3G & 4G Wireless Communications by Prof. Aditya K.
Jagannatham (IIT Kanpur, EEE Dept.)
2. Aditya K. Jagannatham - Principles of Modern Wireless Communications Systems-MC GRAW
HILL INDIA (2015)
3. Wireless Communications Principles and practice by T S. Rappaport, Second edition.
16
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Simulator: MATLAB
Schematic diagram’s:
Theory:
MIMO system have multiple transmit and receive antennas at transmitter and receiver,
respectively. Because of having multiple transmit and receive antennas MIMO systems can be
employed for achieving “Diversity gain” to increase SNR at receiver and also we can do “Spatial
multiplexing” to increase the data rate with same transmit power.
Mathematically we can express the MIMO system model as
Y=HX
17
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Where, hij = MIMO channel coefficient between ith Receive and jth transmit antenna’s.
MIMO Receivers:
a. MIMO Zero-Forcing receiver:
BZF = H† = (HHH)-1HH
The estimated output vector X^ = BZF Y
This receiver Forces (Suppress) Interference to zero but gives Noise enhancement.
MATLAB Code:
18
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
SNRdB = [1:2:20];
...i.e.(=blockLength*iter*numTxAnt)
BER_MF = BER_MF/(blockLength*iter*numTxAnt);
BER_MMSE = BER_MMSE/(blockLength*iter*numTxAnt);
semilogy(SNRdB,BER_ZF,SNRdB,BER_MF,SNRdB,BER_MMSE,'linewidth',2.0); %
Gives Simulated BER
hold on;
end
19
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Procedure:
1. Type the MATLAB code in editor window.
2. Run the code and get the BER curves.
3. Calculate the BER for Various MIMO Receivers, Modulation orders at a given
SNR and tabulate the results.
4. Compare theoretical and Simulated BER Curves for M- ary PSK Modulation
scheme.
Results:
20
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
S. SNR Modulation BER for BER for BER for BER for BER for BER for
no ZF ZF MF MF MMSE MMSE
dB Type
Theoretical Simulated Theoretical Simulated Theoretical Simulated
1 5 BPSK
2 10 BPSK
3 15 BPSK
4 5 QPSK
5 10 QPSK
6 15 QPSK
7 10 BQAM
Selected References:
1. NPTEL online course on Advanced 3G & 4G Wireless Communications by Prof. Aditya K.
Jagannatham (IIT Kanpur, EEE Dept.)
2. Aditya K. Jagannatham - Principles of Modern Wireless Communications Systems-MC GRAW
HILL INDIA (2015)
3. Wireless Communications Principles and practice by T S. Rappaport, Second edition.
21
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Simulator: MATLAB
Schematic diagram’s:
Rx-1 Detection
Cyclic Serial to N-Point Parallel
FFT for 1st
prefix Parallel to Serial
Subcarrier
Removal Converter Converter
P/S
M
U
X
Rx-2 Detection
Serial to N-Point Parallel
Cyclic
FFT For Nth to Serial
prefix Parallel
Subcarrier Converter
Removal Converter
Tx-2 Rx-2
22
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Theory:
MIMO-OFDM is a combination of MIMO with OFDM. It converts a frequency selective MIMO
channel into multiple parallel flat fading MIMO channels. MIMO-OFDM significantly simplifies base
band receiver processing by eliminating the need for a complex MIMO equalizer.
Now the received Symbols on ith Received antenna at any time instant ‘n’ from MIMO ISI channel
after the addition of cyclic prefix in Summation form is given by
𝑇
𝐿
Yi(n) = ∑ (∑𝑙=1 hij(𝑙) Xj(n − 𝑙)) + Wij(n)
𝑗=1
Where,
j = Transmit Antenna index
i = Receive Antenna index
n = Time index
L = No, of taps of ISI channel
hjj = Multipath channel coefficient vector between ith Receive and jth Transmit Antenna’s
Ex: L = 2 implies hjj = [hij(1) hij(2)]T
Wij = Complex AWGN Noise vector between ith Receive and jth Transmit Antenna’s
And the MIMO channel matrix is decomposed as
ℎ11 ℎ12 ℎ13 . . . ℎ1𝑡
ℎ21 ℎ22 ℎ23 . . . ℎ2𝑡
ℎ ℎ32 ℎ33 . . . ℎ3𝑡
𝐻 = 31
. . . . . . .
. . . . . . .
[ℎ𝑟1 ℎ𝑟2 ℎ𝑟3 . . . ℎ𝑟𝑡 ]
Where, hij = MIMO channel coefficient between ith Receive and jth transmit antenna’s.
MIMO-OFDM Receivers:
a. MIMO Zero-Forcing receiver:
BZF = H†sub= (HHsub Hsub)-1HHsub
The estimated output vector X^ = BZF Y;
where, Y = fft of received symbols after removing Cyclic prefix
Hsub = Sub carrier Matrix to detect Nth subcarrier at the receiver
This receiver Forces (Suppress) Interference to zero but gives Noise enhancement.
23
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
MATLAB Code:
% BER Performance of MIMO OFDM System using ZF, MF & LMMSE Receiver's
for M-ary PSK
%% INITIALIZATION
close all;
clear all;
clc;
rng('shuffle');
Nsub = 16;
Ncp = round(Nsub/10);
iter = 10000; % # Iterations
L = 2; % # Channel Taps
T = 2; % # Tx Ants at Transmitter
R = 2; % # Rx Ants at Receiver
SNRdB = [1:2:25];
BER_ZF = zeros(size(SNRdB)); BER_MF = zeros(size(SNRdB)); BER_MMSE =
zeros(size(SNRdB));% Initialization of BER
SNR = zeros(size(SNRdB)); % Initialization of SNR
%% # CONSTELLATION MAPPER
24
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
H_freq(:,:,Tx) = fft([h(:,:,Tx),zeros(R,Nsub-L)],[],2);
LoadedBits = sqrt(SNR(k))*pskmod(Bits(Tx,:),M);
Txsamples = ifft(LoadedBits,Nsub);
Txsamples_WCP = [Txsamples(Nsub-Ncp+1 : Nsub), Txsamples];% Transmitted
samples with CP
Rxsamples_WCP =[];%Initialization of Rxd Samples With Cyclic Prefix
Vector
Rxsamples_WCP = [Rxsamples_WCP;conv(h(Rxi,:,Tx),Txsamples_WCP)];%
Linear Convolution Whose...
...size = numTaps+Nsub(i.e.
size os bits loaded)+Ncp-1
end % End to(6th For)
25
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Processed_Samples = fft(Rxsamples_WoCP,[],2);
%% Detecting Symbols form Processed Samples with MIMO ZF,MF & MMSE
Receiver's
Hsub = squeeze(H_freq(:,nx,:));
Bitsprocessed_ZF = pinv(Hsub)*Processed_Samples(:,nx);% ZF Receiver
Bitsprocessed_MF = Hsub'*Processed_Samples(:,nx);% MF Receiver
Bitsprocessed_MMSE = ((Hsub'*Hsub +
(eye(T))*(1/SNR(k)))\Hsub')*Processed_Samples(:,nx);% MMSE Receiver
DecodedBits_ZF = pskdemod(Bitsprocessed_ZF,M);
DecodedBits_MF = pskdemod(Bitsprocessed_MF,M);
DecodedBits_MMSE = pskdemod(Bitsprocessed_MMSE,M);
BER_ZF(k) = BER_ZF(k) + sum(symerr(Bits(:,nx),DecodedBits_ZF)); % Net
BER
BER_MF(k) = BER_MF(k) + sum(symerr(Bits(:,nx),DecodedBits_MF)); % Net
BER
BER_MMSE(k) = BER_MMSE(k) + sum(symerr(Bits(:,nx),DecodedBits_MMSE)); %
Net BER
SNR_effective = L*SNR/Nsub;
BER_Theoretical = 0.5*(1-sqrt(SNR_effective./(2+SNR_effective))); %
Theoretical formula for OFDM...
26
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
Procedure:
1. Type the MATLAB code in editor window.
2. Run the code and get the BER curves.
3. Calculate the BER for Various MIMO-OFDM Receivers, Modulation orders at a
given SNR and tabulate the results.
4. Compare theoretical and Simulated BER Curves for M- ary PSK Modulation
scheme.
Results:
27
EC736 – Communication & Networking Lab Manual, II Semester M.Tech.(CE), Feb-June 2021
S. SNR Modulation BER for BER for BER for BER for BER for BER for
no ZF ZF MF MF MMSE MMSE
dB Type
Theoretical Simulated Theoretical Simulated Theoretical Simulated
1 5 BPSK
2 10 BPSK
3 15 BPSK
4 5 QPSK
5 10 QPSK
6 15 QPSK
7 10 BQAM
Selected References:
1. NPTEL online course on Advanced 3G & 4G Wireless Communications by Prof. Aditya K.
Jagannatham (IIT Kanpur, EEE Dept.)
2. Aditya K. Jagannatham - Principles of Modern Wireless Communications Systems-MC GRAW
HILL INDIA (2015)
3. Wireless Communications Principles and practice by T S. Rappaport, Second edition.
28