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

Lab Manual

This lab manual document provides instructions and materials for 13 wireless communication experiments to be conducted in the Department of Computer Networks and Communication Engineering at King Khalid University. The experiments cover topics such as data eye diagrams, fading channels, free space path loss modeling, link budget equations, outdoor propagation models, digital modulation techniques, noise modeling, equalization, channel access methods, and error correction coding. The current lab equipment includes desktop computers and MATLAB software, while international standards recommend additional equipment for some experiments.

Uploaded by

A'ziz Mo
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)
91 views48 pages

Lab Manual

This lab manual document provides instructions and materials for 13 wireless communication experiments to be conducted in the Department of Computer Networks and Communication Engineering at King Khalid University. The experiments cover topics such as data eye diagrams, fading channels, free space path loss modeling, link budget equations, outdoor propagation models, digital modulation techniques, noise modeling, equalization, channel access methods, and error correction coding. The current lab equipment includes desktop computers and MATLAB software, while international standards recommend additional equipment for some experiments.

Uploaded by

A'ziz Mo
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/ 48

KING KHALID UNIVERSITY

COLLEGE OF COMPUTER SCIENCE

DEPARTMENT OF COMPUTER NETWORKS AND COMMUNICATION


ENGINEERING

LAB MANUAL

Course Name : Principles of Wireless Communication


Course Code : CNE 322
Level /Year : 8/4
Course Coordinator : Dr. Kanthavel
Lab Teacher : Eng. Sameer Kamarudeen

1|Page
INDEX PAGE

S.No. NAME OF THE EXPERIMENT WEEK PAGE


SCHEDULE NUMBER
1 Represent and analyze a high speed digital I 04
signal by using Data Eye Diagram.
2 Fading Channels in Wireless communication. II 07
3 Free space path loss model. III 10
4 Link Budget Equation IV 13
5 Outdoor propagation models in wireless V 15
communication – Okumura model and Hata
model.
6 Binary Phase Shift Keying Modulation. VI 20
7 Quadrature Phase Shift Keying Modulation. VII 24
8 Delta Modulation / Demodulation VIII 29
9 Compare Bit Error Rate (BER) in different IX 32
Modulation Techniques.
10 Additive White Gaussian Noise (AWGN) in a X 35
channel.
11 Equalizer in wireless communication XI 37
12 Channel Access Methods in wireless XII 42
communication -
Direct Sequence Code Division Multiple Access.
13 Convolutional Coding. XIII 46

2|Page
Current Equipment’s

- Desktop computers
- MATLAB

Equipment Required according to International Standard

- MATLAB

3|Page
EXPERIMENT – I

EYE DIAGRAMS

Explanation: In telecommunication, an eye pattern, also known as an eye


diagram, is an oscilloscope display in which a digital data signal from a receiver is
repetitively sampled and applied to the vertical input, while the data rate is used to
trigger the horizontal sweep. It is so called because, for several types of coding, the
pattern looks like a series of eyes between a pair of rails. It is an experimental tool for
the evaluation of the combined effects of channel noise and inter-symbol interference
on the performance of a baseband pulse-transmission system. It is the synchronized
superposition of all possible realizations of the signal of interest viewed within a
particular signaling interval.

Several system performance measures can be derived by analyzing the


display. If the signals are too long, too short, poorly synchronized with the system
clock, too high, too low, too noisy, or too slow to change, or have too much undershoot
or overshoot, this can be observed from the eye diagram. An open eye pattern
corresponds to minimal signal distortion. Distortion of the signal waveform due to
inter-symbol interference and noise appears as closure of the eye pattern.

The data eye diagram is a methodology to represent and analyze a high speed
digital signal. The eye diagram allows key parameters of the electrical quality of the
signal to be quickly visualized and determined. The data eye diagram is constructed
from a digital waveform by folding the parts of the waveform corresponding to each
individual bit into a single graph with signal amplitude on the vertical axis and time
on horizontal axis.

By repeating this construction over many samples of the waveform, the resultant
graph will represent the average statistics of the signal and will resemble an eye.

4|Page
Objective:

Illustrate the use of the eye diagram for finding the best decision point.

Theory:

The code below illustrates the use of the eye diagram for finding the best decision
point. It maps a random digital signal to a 16-QASK waveform, and then uses a raised
cosine filter to simulate a noisy transmission channel. Several commands manipulate
the filtered data to isolate its steady- state behaviour.

Program:
% Define the M-ary number and sampling rates.
M = 16; Fd = 1; Fs = 10;

Pd = 100; % Number of points in the calculation


msg_d = randint(Pd,1,M); % Random integers in the range [0,M-1]

% Modulate using square constellation QASK method.


msg_a = modmap(msg_d,Fd,Fd,'qask',M);

% Assume the channel is equivalent to a raised cosine filter.


delay = 3; % Delay of the raised cosine filter rcv
= rcosflt(msg_a,Fd,Fs,'fir/normal',.5,delay);

% Truncate the output of rcosflt to remove response tails. propdelay =


delay .* Fs/Fd + 1; % Propagation delay of filter
rcv1 = rcv(propdelay:end-(propdelay-1),:); % Truncated
version N = Fs/Fd;

% Plot the eye diagram of the resulting signal sampled and


% displayed with no offset.
offset1 = 0;

h1 = eyediagram(rcv1,N,1/Fd,offset1);
set(h1,'Name','Eye Diagram Displayed with No Offset');

5|Page
Program 2:

Plot the eye diagram of the sampled signal with the offset of 2.

offset2 = 2;
h2 = eyediagram(rcv1,N,1/Fd,offset2,'r-'); set(h2,'Name','Eye
Diagram Displayed with Offset of Two');

Output:

6|Page
EXPERIMENT – II

FADING CHANNELS IN WIRELESS COMMUNICATION

Explanation: In wireless communications, fading is deviation of the attenuation


affecting a signal over certain propagation media. The fading may vary with time,
geographical position or radio frequency, and is often modeled as a random
process. A fading channel is a communication channel comprising fading. In
wireless systems, fading may be either due to multipath propagation, referred to
as multipath induced fading, or due to shadowing from obstacles affecting the
wave propagation, sometimes referred to as shadow fading.

The presence of reflectors in the environment surrounding a transmitter


and receiver create multiple paths that a transmitted signal can traverse. As a result,
the receiver sees the superposition of multiple copies of the transmitted signal, each
traversing a different path. Each signal copy will experience differences in
attenuation, delay and phase shift while travelling from the source to the receiver.
This can result in either constructive or destructive interference, amplifying or
attenuating the signal power seen at the receiver. Strong destructive interference is
frequently referred to as a deep fade and may result in temporary failure of
communication due to a severe drop in the channel signal-to-noise ratio.

7|Page
Objective: To generate data and apply fading channels. Also compute error rate for
different values of Sound to Noise ratio (SNR) and hence plot it’s Bit Error Rate
(BER).

Program:

c = rayleighchan(1/10000,100);
sig = 1i*ones(2000,1); % Generate signal
y = filter(c,sig); % Pass signal through channel
c % Display all properties of the channel

% Plot power of faded signal, versus sample number


plot(20*log10(abs(y)))

% Create Rayleigh fading channel object


chan = rayleighchan(1/10000,100);

% Generate data and apply fading channel


M = 2; % DBPSK modulation order
hMod = modem.dpskmod('M', M); % Create a DPSK modulator
hDemod = modem.dpskdemod(hMod); % Create a DPSK demodulator
% using the modulator
tx = randi([0 M-1],50000,1); % Generate a random bit stream
dpskSig = modulate(hMod, tx) % DPSK modulate the signal
fadedSig = filter(chan,dpskSig); % Apply the channel effects

% Compute error rate for different values of SNR


SNR = 0:2:20; % Range of SNR values, in dB.
numSNR = length(SNR);
BER = zeros(1, numSNR);
for n = 1:numSNR
rxSig = awgn(fadedSig,SNR(n)); % Add Gaussian noise
rx = demodulate(hDemod, rxSig); % Demodulate reset(hDemod);

% Compute error rate


[nErrors, BER(n)] = biterr(tx,rx); end

% Compute theoretical performance results, for


comparison BERtheory = berfading(SNR,'dpsk',M,1);

% Plot BER results


semilogy(SNR,BERtheory,'b-',SNR,BER,'r*');
legend('Theoretical BER','Empirical BER');
xlabel('SNR (dB)'); ylabel('BER');
title('Binary DPSK over Rayleigh Fading Channel');
8|Page
Output:

c=

ChannelType: 'Rayleigh'
InputSamplePeriod: 1.0000e-004
DopplerSpectrum: [1x1
doppler.jakes] MaxDopplerShift:
100
PathDelays: 0
AvgPathGaindB: 0
NormalizePathGains: 1
StoreHistory: 0
StorePathGains: 0 PathGains:
0.9155 - 0.8059i
ChannelFilterDelay: 0
ResetBeforeFiltering: 1
NumSamplesProcessed: 2000

Output

9|Page
EXPERIMENT – III

FREE SPACE PATH LOSS MODEL

Objective: To determine the free space loss and the power received using Matlab program.

Theory:
The free space path loss, also known as FSPL is the loss in signal strength
that occurs when an electromagnetic wave travels over a line of sight path in free
space. In these circumstances there are no obstacles that might cause the signal to
be reflected refracted, or that might cause additional attenuation.
The free space path loss calculations only look at the loss of the path itself
and do not contain any factors relating to the transmitter power, antenna gains or
the receiver sensitivity levels.
To understand the reasons for the free space path loss, it is possible to
imagine a signal spreading out from a transmitter. It will move away from the
source spreading out in the form of a sphere. As it does so, the surface area of the
sphere increases. As this will follow the law of the conservation of energy, as the
surface area of the sphere increases, so the intensity of the signal must decrease.
As a result of this it is found that the signal decreases in a way that is inversely
proportional to the square of the distance from the source of the radio signal

Free space path loss formula

The free space path loss formula or free space path loss equation is quite
simple to use. Not only is the path loss proportional to the square of the
distance between the transmitter and receiver, but the signal level is also
proportional to the square of the frequency in use.
FSPL = (4πd/ λ)2 = (4πdf/ c)2

FSPL is the Free space path loss d is the distance of the receiver from the
transmitter (metres) λ is the signal wavelength (meters) f is the signal frequency
(Hertz) c is the speed of light in a vacuum (meters per second)
The free space path loss formula is applicable to situations where only the
electromagnetic wave is present, i.e. for far field situations. It does not hold true for
near field situations.

10 | P a g e
Decibel version of free space path loss equation
Most RF comparisons and measurements are performed in decibels. This gives an
easy and consistent method to compare the signal levels present at various points.
Accordingly it is very convenient to express the free space path loss formula, FSPL,
in terms of decibels..

FSPL (dB) = 20 log10 (d) + 20 log10 (f) + 32.44


Where: d is the distance of the receiver from the transmitter (km) f is the signal
frequency (MHz)

Affect of antenna gain on path loss equation


The equation above does not include any component for antenna gains. It is
assumed that the antenna gain is unity for both the transmitter. In reality, though, all
antennas will have a certain amount of gain and this will affect the overall affect.
Any antenna gain will reduce the "loss" when compared to a unity gain system. The
figures for antenna gain are relative to an isotropic source, i.e. an antenna that
radiates equally in all directions.

FSPL (dB) = 20 log10 (d) + 20 log10 (f) + 32.44 -Gtx - Grx


Where: Gtxis the gain of the transmitter antenna relative to an isotropic source
(dBi) Grxis the gain of the receiver antenna relative to an isotropic source (dBi)

The free space path loss equation or formula given above, is an essential tool that is
required when making calculations for radio and wireless systems either manually
or within applications such as wireless survey tools, etc. By using the free space path
loss equation, it is possible to determine the signal strengths that may be expected
in many scenarios. While the free space path loss formula is not fully applicable
where there are other interactions, e.g. reflection, refraction, etc as are present in
most real life applications, the equation can nevertheless be used to give an
indication of what may be expected. It is obviously fully applicable to satellite
systems where the paths conform closely to the totally free space scenarios

Power Received :

[Pr] = [pt] + [Gt] + [Gr] – [FSPL]

Pr – Received power Pt – Transmitted power


Gt – Gain of the transmitting antenna Gr – Gain of the receiving antenna

11 | P a g e
Program:

clc;
close
all;
clear
all;
f=input('enter the frequency in Mhz: ');
L=300/f; %calculating wavelength
disp('thus the wavelength is: ');
L %displaying wavelength
d=input('enter the distance in km: ');
Gt=input('enter the transmitting antenna gain in db: ');
Gr=input('enter the receiving antenna gain in db: ');

Wt=input('enter the transmitted power in db: ');


ls=32.44+20*log10(d)+20*log10(f); %calculating path
loss disp(sprintf('%s %d %s','the path loss is:',ls,'db'));
%displaying path
loss Wr=Wt+Gt+Gr-ls; %calculating recieved power in db
disp(sprintf('%s %d %s','therecieved power
is:',Wr,'db')); wr=10^(Wr/10); %calculating
recieved power in watts disp(sprintf('%s %d
%s','therecieved power is:',wr,'watts'));
%displaying received power in watts

Result:
The program for power received by an antenna and path loss in Free space
propagation was simulated successfully.

12 | P a g e
EXPERIMENT 4
LINK BUDGET EQUATION – SATELLITE COMMUNICATION

Aim :
To write a Matlab program to calculate the link budget for satellite communication.

Theory :
A link budget is an accounting of all the gains and losses in a transmission system. The link
budget looks at the elements that will determine the signal strength arriving at the receiver. The
link budget may include the following items:
Tansmitter power.
Atenna gains (receiver and transmitter).
Antenna feeder losses (receiver and transmitter).
Path losses.

Receiver sensitivity (although this is not part of the actual link budget, it is necessary to
know this to enable any pass fail criteria to be applied.
Where the losses may vary with time, e.g. fading, and allowance must be made within the
link budget for this - often the worst case may be taken, or alternatively an acceptance of periods
of increased bit error rate (for digital signals) or degraded signal to noise ratio for analogue
systems.
Received power (dBm) = Transmitted power (dBm) + gains (db) - losses (dB)
The basic calculation to determine the link budget is quite straightforward. It is mainly a
matter of accounting for all the different losses and gains between the transmitter and the
receiver.
Losses = FSL + AML + RFL + PL + AA
FSL = Freespace loss AML = Antenna Misalignment loss
RFL=Receiver Feeder loss PL=Polarization Loss
AA = Atmospheric Absorption.

13 | P a g e
Carrier to Noise Ratio – Uplink
CNRu=EIRPu+GTRu-Lossu+228.6
Carrier to Noise Ratio – Uplink
CNRd=EIRPd+GTR-Lossd+228.6
Overall Carrier to Noise Ratio
CNRoverall=CNRu X CNRd / (CNRu+CNRd)

Program:
clc;
close all;
clear all;
pt=input('enter the input power in watts:');
Pt=10*log10(pt) %calculating transmitted power in db
gt=input('enter the transmitting antenna gain in db:');
gs=input('enter the recieving antenna gain in db:');
EIRP=Pt+gt %calculating EIRP
d=input('enter the distance in km:');
f=input('enter the frequency in mhz:');
fsl=32.4+20*log10(d)+20*log10(f) %calculating path loss
rfl=input('enter the reciever feeder loss in db:');
aa=input('enter the atmospheric absorption in db:');
aml=input('enter the antenna misalignment loss in db:');
pl=input('enter the polarization loss in db:');
losses=fsl+rfl+aa+aml+pl; %calculating total losses
disp(sprintf('%s %f %s','total loss',losses,'db'));
P=EIRP+gs-losses; %calculating power recieved
disp(sprintf('%s %f %s','Total recieved power =',P,'db'));
Result:
The Matlab program for calculating the link budget was simulated successfully

14 | P a g e
Experiment 5

OUTDOOR PRPOGATION MODELS IN WIRELESS COMMUNICATION –

OKUMURA MODEL & HATA MODEL

Explanation: Outdoor Propagation Model is an empirical mathematical formulation


for the characterization of radio wave propagation as a function of frequency,
distance and other conditions. A single model is usually developed to predict the
behavior of propagation for all similar links under similar constraints. Created
with the goal of formalizing the way radio waves are propagated from one place to
another, such models typically predict the path loss along a link or the effective
coverage area of a transmitter.

As the path loss encountered along any radio link serves as the dominant
factor for characterization of propagation for the link, radio propagation models
typically focus on realization of the path loss with the auxiliary task of predicting
the area of coverage for a transmitter or modeling the distribution of signals over
different regions.
Because each individual telecommunication link has to encounter different
terrain, path, obstructions, atmospheric conditions and other phenomena, it is
intractable to formulate the exact loss for all telecommunication systems in a single
mathematical equation. As a result, different models exist for different types of
radio links under different conditions. The models rely on computing the median
path loss for a link under a certain probability that the considered conditions will
occur. Different models have been developed to meet the needs of realizing the
propagation behavior in different conditions.

15 | P a g e
OKUMURA MODEL

Objective: To write a Matlab program to calculate the median path loss for
Okumura model for outdoor propagation.

Theory:
The Okumura model for Urban Areas is a Radio propagation model that was built
using the data collected in the city of Tokyo, Japan. The model is ideal for using in
cities with many urban structures but not many tall blocking structures. The model
served as a base for the Hata Model.

Okumura model was built into three modes. The ones for urban, suburban and open
areas. The model for urban areas was built first and used as the base for others.

Coverage
Frequency = 150 MHz to 1920 MHz
Mobile Station Antenna Height: between 1 m and 10
m Base station Antenna Height: between 30 m and
1000 m Link distance: between 1 km and 100 km

Mathematical formulation
The Okumura model is formally expressed as:
L = LFSL + AMU – HMG – HBG – Σ KCORRECTION
where,
L = The median path loss. Unit: Decibel (dB)
LFSL = The Free Space Loss. Unit: Decibel(dB)
AMU = Median attenuation.Unit: Decibel(dB)
HMG = Mobile station antenna height gain factor.
HBG = Base station antenna height gain factor.
Kcorrection = Correction factor gain (such as type of environment, water
surfaces, isolated obstacle etc.)
Okumura model does not provide a mean to measure the Free space loss.
However, any standard method for calculating the free space loss can be
used.

16 | P a g e
Program:
clc; clear all;
close all;
Lfsl=input('enter the free space loss:');
Amu=input('enter the median attenuation value:');
Hmg=input('enter the Mobile station antenna height gain factor:');
Hbg=input('enter the Base station antenna height gain factor:');
Kc=input('enter the Correction factor gain:');
L=Lfsl+Amu-Hmg-Hbg-Kc; %calculating median path loss
disp(sprintf('%s %f %s','the median path loss:',L,'dB'));

Result:
The program for Okumura Model – Outdoor Propagation was simulated successfully.

17 | P a g e
HATA MODEL

Objective: To write a Matlab program to calculate the median path loss for Hata
model for outdoor propagation.

Theory:

In wireless communication, the Hata Model for Urban Areas, also known as the Okumura-
Hata model for being a developed version of the Okumura Model, is the most widely used
radio frequency propagation model for predicting the behaviour of cellular transmissions
in built up areas. This model incorporates the graphical information from Okumura model
and develops it further to realize the effects of diffraction, reflection and scattering caused
by city structures. This model also has two more varieties for transmission in Suburban
Areas and Open Areas.

Hata Model predicts the total path loss along a link of terrestrial microwave or other
type of cellular communications. This particular version of the Hata model is applicable
to the radio propagation within urban areas. This model is suited for both point-to-point
and broadcast transmissions and it is based on extensive empirical measurements
taken.PCS is another extension of the Hata model. The Walfisch and Bertoni Model is
further advanced.

Coverage:
- Frequency: 150 MHz to 1500 MHz
- Mobile Station Antenna Height: between 1 m and 10 m Base station
Antenna Height: between 30 m and 200 m
- Link distance: between 1 km and 20 km.

Mathematical formulation
Hata Model for Urban Areas is formulated as:

LU = 69.55 + 26.16 log f – 13.82 log hB – CH + [ 44.9 – 6.55 log hB] log d.
For small or medium sized city,

CH = 0.8 + (1.1 log f – 0.7 )hM – 1.56 log f.


and for large cities,

CH = 8.29 (log (1.54 hM))2 – 1.1 , if 150 ≤ f ≤ 200


CH = 3.2 (log (11.75 hM))2 – 4.97 , if 200 ≤ f ≤ 1500

18 | P a g e
Where,
- LU = Path loss in Urban Areas (dB)
- hB= Height of base station Antenna. (m)
- hM = Height of mobile station Antenna. (m)
- f= Frequency of Transmission (MHz).
- CH = Antenna height correction factor
- d= Distance between the base and mobile stations (km).
- The term "small city" means a city where the mobile antenna height not more than
10 meters. i.e. 1 ≤ hM ≤ 10m

Program:
clc; clear all;
close all;
f=input('enter the frequency of transmisson in mhz:');
Hb=input('enter the height of base station Antenna in meter:');
Hm=input('enter the height of mobile station Antenna in meter:');
d=input('enter the distance between the base and mobile stations:');
n=input('enter 0 for small city and 1 for large city:');
if n==0
ch=0.8+(1.1*log10(f)-0.7)*Hm-1.56*log10(f); else
if f>=150 && f<=200 ch=8.29*(log10(1.54*Hm))^.2-1.1;
else
if f>=200 && f<=1500
ch=3.2*(log10(11.75*Hm))^.2- 4.97;
end;
end;
end;
Lu=69.55+26.26*log10(f)-13.82*log10(Hb)-ch+(44.9-.55*log10(Hb))*log10(d);
disp(sprintf('%s %f %s','Path loss in Urban Areas=',Lu,'db'));

Result:
The program for Hata Model – Outdoor Propagation was simulated successfully.

19 | P a g e
EXPERIMENT – VI

BINARY PHASE SHIFT KEYING MODULATION

Objective: Simulation of Digital Communication System by simulating BPSK (Binary


Phase Shift Keying) using MATLAB

Theory:

BPSK is a change in the phase signal that is used to transmit binary messages. BPSK is
most simple form of Phase shift keying.

Note: Phase shift keying is a digital modulation scheme that conveys data by changing,
or modulating, the phase of a reference signal.

Generation of BPSK

Sinusoidal carrier wave is modulated by b-polar bit stream. It’s polarity will be
reversed every time the bit stream changes polarity.

20 | P a g e
BPSK Signal in time domain

The wave shape is ‘symmetrical’ at each phase transition. This is because the bit rate
is a sub- multiple of the carrier frequency ω/(2π). In addition, the message
transitions have been timed to occur at a zero-crossing of the carrier.

MATLAB Code:

%This program simulates BER of BPSK in AWGN

channel% clear all; close all; clc;

num_bit=100000; %Signal length

max_run=20; %Maximum number of iterations for a single SNR

Eb=1; %Bit energy

SNRdB=0:1:9; %Signal to Noise Ratio (in dB)

SNR=10.^(SNRdB/10);

hand=waitbar(0,'Please Wait ');

for count=1:length(SNR) %Beginning of loop for different SNR

avgError=0;

No=Eb/SNR(count); %Calculate noise power from

SNR for run_time=1:max_run %Beginning of loop for different runs

waitbar((((count-1)*max_run)+run_time-

1)/(length(SNRdB)*max_run)); Error=0;

data=randint(1,num_bit); %Generate binary data source


21 | P a g e
s=2*data-1; %Baseband BPSK modulation

N=sqrt(No/2)*randn(1,num_bit); %Generate AWGN

Y=s+N; %Received Signal

for k=1:num_bit %Decision device taking hard decision and deciding error
if ((Y(k)>0 && data(k)==0)||(Y(k)<0 && data(k)==1))

Error=Error+1;

end

end

Error=Error/num_bit; %Calculate error/bit

avgError=avgError+Error; %Calculate error/bit for different runs

end %Termination of loop for different runs

BER_sim(count)=avgError/max_run; %Calculate BER for a particular SNR

end %Termination of loop for different SNR

BER_th=(1/2)*erfc(sqrt(SNR)); %Calculate analytical BER

close(hand);
semilogy(SNRdB,BER_th,'k'); %Plot

BER hold on

semilogy(SNRdB,BER_sim,'k*');

legend('Theoretical','Simulation',3);

axis([min(SNRdB) max(SNRdB) 10^(-5) 1]);

hold off

22 | P a g e
Output:

23 | P a g e
EXPERIMENT – VII

QUADRATURE PHASE SHIFT KEYING MODULATION

Objective: Simulate a QPSK modulation scheme and design the constellation diagram
by showing the four basic QPSK angles.

Theory:

QPSK (Quadrature Phase Shift Keying) is type of phase shift keying. Unlike BPSK
which is a DSBCS modulation scheme with digital information for the message, QPSK
is also a DSBCS modulation scheme but it sends two bits of digital information a
time (without the use of another carrier frequency).

Note: The amount of radio frequency spectrum required to transmit QPSK reliably
is half that required for BPSK signals, which in turn makes room for more users on
the channel.

The figure below shows a QPSK modulated waveform.

24 | P a g e
Generation of a QPSK signal:
Figure below shows the block diagram of the mathematical implementation of QPSK.

At the input of the modulator, the digital data’s even bits (i.e., bits 0,2,4 and so on)
are stripped from the data stream by a “bit-splitter” and are multiplied with a
carrier to generate a BPSK signal (called PSKI). At the same time, the data’s odd bits
(i.e., bits 1,3,5 and so on) are stripped from the data stream and are multiplied with
the same carrier to generate a second BPSK signal (called PSKQ). However, the PSKQ
signal’s carrier is phase shifted by 90o before being modulated.

The two BPSK signals are then simply added together for transmission and, as they
have the same carrier frequency, they occupy the same portion of the radio
frequency spectrum. While this suggests that the two sets of signals would be
irretrievably mixed, the required 90o of phase separation between the carriers
allows the sidebands to be separated by the receiver using phase discrimination.
The constellation diagram of QPSK is as shown below:

25 | P a g e
With four phases, QPSK can encode two bits per symbol shown in the diagram to
minimize the BER- twice the rate of BPSK. Analysis shows that this may be used
either to double the data rate compared to a BPSK system while maintaining the
bandwidth of the signal or to maintain the data rate of BPSK but half the bandwidth
needed.

Writing the symbols in the constellation diagram in terms of sine and cosine waves
used to transmit them. This yields the four phase’s π/4, 3π/4, 5π/4 and 7π/4 as
needed. This results in a two dimensional signal space with unit basis functions. The
first basis function is used as the in- phase component of the signal and the second
as the quadrature component of the signal. Hence the signal constellation consists of
the signal- space 4 points.

26 | P a g e
27 | P a g e
28 | P a g e
EXPERIMENT – VIII

DELTA MODULATION/DEMODULATION

Aim:- To simulate and analyze Delta Modulation/ Demodulation Techniques.

Tool used:- MATLAB software

Theory:-

Delta modulation (DM or Δ-modulation) is an analog-to-digital and digital-to-analog


signal conversion technique used for transmission of voice information where
quality is not of primary importance. DM is the simplest form of differential pulse-
code modulation (DPCM) where the differences between successive samples are
encoded into n-bit data streams. In delta modulation, the transmitted data are
reduced to a 1-bit data stream.

Its main features are:

 The analog signal is approximated with a series of segments

 Each segment of the approximated signal is compared to the


original analog wave to determine the increase or decrease in
relative amplitude
 The decision process for establishing the state of successive bits
is determined by this comparison
 Only the change of information is sent, that is, only an increase or
decrease of the signal amplitude from the previous sample is sent
whereas a no-change condition causes the modulated signal to
remain at the same 0 or 1 state of the previous sample.

To achieve high signal-to-noise ratio, delta modulation must use oversampling


techniques, that is, the analog signal is sampled at a rate several times higher than
the Nyquist rate.

Derived forms of delta modulation are continuously variable slope delta


modulation, delta-sigma modulation, and differential modulation.

29 | P a g e
Program:

clc;
clear all;
close all;
a=2;
t=0:2*pi/50:2*pi;
x=a*sin(t);
l=length(x);
plot(x,'r');
delta=0.2;
hold on
xn=0;
for i=1:l;
if x(i)>xn(i)
d(i)=1;
xn(i+1)=xn(i)+delta;
else
d(i)=0;
xn(i+1)=xn(i)-delta;
end
end stairs(xn)
hold on
for i=1:d
if d(i)>xn(i)
d(i)=0;
xn(i+1)=xn(i)-delta;
else
d(i)=1;
xn(i+1)=xn(i)+delta;
end
end plot(xn,'c');
legend('Analog signal','Delta modulation','Demodulation')
title('DELTA MODULATION / DEMODULATION ')

30 | P a g e
Output:

Result: The program to simulate Delta Modulation/ Demodulation has been completed and
plotted successfully.

31 | P a g e
EXPERIMENT –IX

COMPARE BIT ERROR RATE, BER, IN DIFFERENT MOUDLATION TECHNIQUES.

Objective:

To study the relationship between the signal power Eb/N0, Bit Error Rate BER with
different bit rate in BPSK,QPSK, 8 QAM, 16QAM by using BER Analyzing tool in
Matlab.

Description:
- BPSK :
Number of bits = 1
Number of angles = 2
BPSK constellation diagram:

- QPSK :
Number of bits = 2
Number of angles
=4
QPSK constellation diagram:

- 8QAM :
Number of bits = 3
Number of symbols = 8
8QAM constellation diagram:

- 16 QAM:
Number of bits = 4
Number of Symbols = 16
16QAM constellation diagram:

32 | P a g e
Case Study: we are using BER tool to show many

33 | P a g e
Comparison Table:

Eb/N0 // Type BPSK QPSK 8QAM 16QAM


6
8
10
12

34 | P a g e
35

EXPERIMENT – X

ADDITIVE WHITE GAUSSIAN (AWGN) IN A CHANNEL

Objective:

Simulation of a Channel by introducing AWGN using MATLAB

Theory:

AWGN is the random statistical noise in the background of a communication channel.


It is characterized by having a large frequency.

The basic measure of performance is the capacity of a channel: the maximum rate of
communication for which arbitrarily small error probability can be achieved. AWGN
(Additive White Gaussian Noise) channel is then used as a building block to study the
capacity of wireless fading channels.

In this section, the focus is on the familiar (real) AWGN channel:

Y[m] = x[m] +w[m]

Where x[m] and y[m] are real input and output at time m respectively and w[m]is N,
noise, independent over time.

Matlab Code:

Introducing AWGN

fs = 10^5; N = 10^5;

t = 1/fs:1/fs:N/fs; fm = 2;

fc = 10^3;

m = sin(2*pi*fm*t);

c = sin(2*pi*fc*t);

v = m.*c;

SNRdB = 10;
SNR = 10^(SNRdB/10);

35 | P a g e
36

vn = var(v)/SNR;
n = sqrt(vn)*randn(1,N);

v = v + n;

r=zeros(1,N);

n=fs/fc;

for k=1: fc

mr((k-1)*n+1:k*n)=2*v((k-1)*n+1:k*n)*c((k- 1)*n+1:k*n)'/n;

end

figure(1)

subplot(2,1,1); plot(t,m);

subplot(2,1,2); plot(t,mr);axis([0 1 -1 1])


Output

36 | P a g e
37

EXPERIMENT – XI

EQUALIZER IN WIRELESS COMMUNICATION

Explanation: In telecommunication, the equalizer is a device that attempts to


reverse the distortion incurred by a signal transmitted through a channel. In digital
communications, its purpose is to reduce inter-symbol interference to allow recovery
of the transmit symbols. It may be a simple linear filter or a complex algorithm. The
following equalizer types are commonly used in digital communications:

o Linear Equalizer: processes the incoming signal with a linear filter

o Decision Feedback Equalizer: augments a linear equalizer by adding a filtered


version of previous symbol estimates to the original filter output

o Blind Equalizer: estimates the transmitted signal without knowledge of the


channel statistics, using only knowledge of the transmitted signal's statistics.

o Adaptive Equalizer: is typically a linear equalizer or a DFE. It updates the equalizer


parameters (such as the filter coefficients) as it is processes the data

o Viterbi Equalizer: Finds the maximum likelihood (ML) optimal solution to the
equalization problem. Its goal is to minimize the probability of making an error
over the entire sequence.

o Turbo equalizer: applies turbo decoding while treating the channel as a


convolutional code.

Objective: Plot the un-equalized channel frequency response, and the BER of an
ideal BPSK system using MLSE equalizer parameters.

Theory:

The maximum likelihood sequence estimation isan optimum equalization technique


implemented using the Viterbi algorithm. The “mlse” function uses the Viterbi
algorithm to equalize a signal through a dispersive channel. The function receives a
baseband linearly modulated input signal and outputs the maximum likelihood
sequence estimate of the signal, using an estimate of the channel modeled as a finite
input response (FIR) filter.

37 | P a g e
38

Program:

% MLSE equalizer parameters

tbLen = 30; % MLSE equalizer traceback length


numStates = M^(chnlLen-1); % number of trellis states
[mlseMetric, mlseStates, mlseInputs] = deal([]);

const = get(hMod, 'Constellation'); % signal constellation

mlseType = 'ideal'; % perfect channel estimates at first


mlseMode = 'cont'; % no MLSE resets

% Channel estimation parameters

chnlEst = chnl; % perfect estimation initially


prefixLen = 2*chnlLen; % cyclic prefix length
excessEst = 1; % length of estimated channel impulse response
% beyond the true length
% Initialize the graphics for the simulation. Plot the unequalized channel
% frequency response, and the BER of an ideal BPSK system.
idealBER = berawgn(EbNo, 'psk', M, 'nondiff');

[hBER, hLegend, legendString, hLinSpec, hDfeSpec, hErrs, hText1, hText2,... hFit,


hEstPlot, hFig, hLinFig, hDfeFig] = eqber_graphics('init', chnl, ... EbNo, idealBER,
nBits);

38 | P a g e
39

Note: Input Parameters (Given in Exam)

39 | P a g e
40

Signal and Channel Parameters


% System simulation parameters
Fs = 1; % sampling frequency (notional)

nBits = 2048; % number of BPSK symbols per vector

maxErrs = 200; % target number of errors at each Eb/No

maxBits = 1e6; % maximum number of symbols at each Eb/No

% Modulated signal parameters


M = 2; % order of modulation
Rs = Fs; % symbol rate
nSamp = Fs/Rs; % samples per symbol

Rb = Rs * log2(M); % bit rate % Channel parameters

chnl = [0.227 0.460 0.688 0.460 0.227]'; % channel impulse response


chnlLen = length(chnl); % channel length, in samples
EbNo = 0:14; % in dB
BER = zeros(size(EbNo)); % initialize values % Create PSK modulator
hMod = modem.pskmod(M);

% Create a local random stream to be used by random number generators for


% repeatability.
hStream = RandStream('mt19937ar', 'Seed', 12345);

40 | P a g e
41

Adaptive Equalizer Parameters

% Linear equalizer parameters


nWts = 31; % number of weights
algType1 = 'rls'; % RLS algorithm for first data block at each Eb/No
forgetFactor = 0.999999; % parameter of RLS algorithm

algType2 = 'lms'; % LMS algorithm for remaining data blocks


stepSize = 0.00001; % parameter of LMS algorithm

% DFE parameters - use same update algorithms as linear equalizer


nFwdWts = 15; % number of feed forward weights

nFbkWts = 15; % number of feedback weights

41 | P a g e
42

EXPERIMENT – XII

CHANNEL ACCESS METHODS IN WIRELESS COMMUNICATION


DIRECT SEQUENCE – CODE DIVISION MULTIPLE ACCESS

In telecommunications and computer networks, a channel access method or


multiple access method allows several terminals connected to the same multi-point
transmission medium to transmit over it and to share its capacity. Examples of shared
physical media are wireless networks, bus networks, ring networks, star networks
and half-duplex point-to-point links. A channel-access scheme is based on a
multiplexing method that allows several data streams or signals to share the same
communication channel or physical medium.

Code Division Multiple Access (CDMA) is a channel access method used


in various wireless communication technologies. CDMA is an example of multiple
accesses, which is where several transmitters can send information simultaneously
over a single communication channel. This allows several users to share a band of
frequencies (see bandwidth). To permit this to be achieved without undue
interference between the users, CDMA employs spread- spectrum technology and a
special coding scheme (where each transmitter is assigned a code).
Direct sequence spread spectrum, also known as Direct Sequence Code Division
Multiple Access (DS-CDMA), is one of two approaches to spread spectrum
modulation for digital signal transmission over the airwaves. In direct sequence
spread spectrum, the stream of information to be transmitted is divided into small
pieces, each of which is allocated across to a frequency channel across the spectrum. A
data signal at the point of transmission is combined with a higher data-rate bit
sequence (also known as a chipping code) that divides the data according to a
spreading ratio. The redundant chipping code helps the signal resist interference and
also enables the original data to be recovered if data bits are damaged during
transmission.

Direct sequence contrasts with the other spread spectrum process, known as
frequency hopping spread spectrum, or Frequency Hopping Code Division Multiple
Access (FH-CDMA), in which a broad slice of the bandwidth spectrum is divided into
many possible broadcast frequencies. In general, frequency-hopping devices use less
power and are cheaper, but the performance of DS- CDMA systems is usually better
and more reliable.

In recent years, researchers have turned their attention to applying spread spectrum
processes for commercial purposes, especially in local area wireless networks.

42 | P a g e
43

Objective: To study Channel Access Method by implementing direct sequence code


division multiple access (DS-CDMA) using MATLAB program.

Theory:

In Direct Sequence spread spectrum transmission, the user data signal is multiplied by
a code sequence. Mostly, binary sequences are used. The duration of an element in the
code is called the "chip time". The ratio between the user symbol time and the chip
time is called the spread factor. The transmit signal occupies a bandwidth that equals
the spread factor times the bandwidth of the user data.

Figure: A DS-CDMA signal is generated by multiplication of a user data


signal by a code sequence.

In the receiver, the received signal is again multiplied by the same (synchronized)
code. This operation removes the code, so we recover the transmitted user data. A
CDMA receiver can retrieve the wanted signal by multiplying the receive signal with
the same code as the one used during transmission. We find:

Where, c1 is the code sequence used by user 1, Tc is the chip duration, td is a common
time offset, shared between transmitter and receiver and N is the length of the code
sequence.. Note that the receive code must be perfectly time aligned with the transmit
code

43 | P a g e
44

Program:

clear all;
close all;
clc;

%% Deciding the Number of users and the Number of bits for each user (same
%% for all users)
x= input ('Number of users =');
y=input('Number of Bits for each user = ');
r=log(x)/log(2)

%% Generating the Walsh Code


xx=hadamard(x); wmmsnn=xx(:,:);
u=[];
m=[];

for t = 1 : x
u=[u; (randint(1,y,2)*2-1)];
m=[m ; (kron(u(t,:),wmmsnn(t,:)))];
end

%% combining all the messages together and normalize it.


mms=sum(m)/x;

y2 =rectpulse(mms,r);

%% Pass through AWGN


channel snrloop=-5:1:35;
numsnr=length(snrloop);
bervec=[];

for n=1:numsnr
mmsn2=awgn(y2,snrloop(n),'measured');

44 | P a g e
45

%% Integrate and dump (downsampling)

mmsn=intdump(mmsn2,r);
mmsn=dp_nrz_L(mmsn7);
end

%% Decode the recieved noisy signal to reproduce the original messages.


g=ones(1,y);

outmsg=[];

for rb=1:x
g1=kron(g,wmmsnn(rb,:));
r1= g1.*mmsn;

rr1=reshape(r1,x,length(r1)/x);
k1=sum(rr1);
u11=k1>0;
outmsg=[outmsg;u11];
end

45 | P a g e
46

EXPERIMENT – XIII

CONVOLUTIONAL CODING

Explanation: In telecommunication, a convolution code is a type of error-correcting


code in which

 Each m-bit information symbol (each m-bit string) to be encoded is


transformed into an n- bit symbol, where m/n is the code rate (n ≥ m) and
 The transformation is a function of the last k information symbols, where k is
the constraint length of the code.

The encoding process of convolutional codes is significantly different to that of block


encoding. Block codes are developed through the use of algebraic techniques. Block
encoders group information bits into length k blocks. These blocks are then mapped
into code words of length n. A convolution encoder converts the entire input stream
into length n code words independent of the length k.

The difference between block codes and convolutional codes is the encoding principle.
In the block codes, the information bits are followed by the parity bits. In
convolutional codes the information bits are spread along the sequence. That means
that the convolutional codes map information to code bits not block wise, but
sequentially convolve the sequence of information bits according to some rule. The
code is defined by the circuit, which consists of different number of shift registers
allowing building different codes in terms of complexity.

46 | P a g e
47

Objective: To determine number of errors in puncturing by implementing punctured


convolution code in MATLAB.

Theory:

A punctured code is obtained by periodically deleting (or puncturing) encoded


symbols from ordinary encoded sequences. This process is named puncturing.

The idea of puncturing is to delete some bits in the code bit sequence according to a
fixed rule. In general the puncturing of a rate K / N code is defined using N puncturing
vectors. Each table contains p bits, where p is the puncturing period. If a bit is 1 then
the corresponding code bit is not deleted, if the bit is 0, the corresponding code bit is
deleted. The N puncturing vectors are combined in a N * p puncturing matrix P.

Since the complexity of Viterbi decoding is exponential in the number of input


symbols as k gets large implementation complexity becomes difficult. Classes of codes
called punctured convolutional codes were introduced by Cain and Clark in 1979. By
periodically deleting bits via a puncturing matrix these codes allow for higher rate
codes, which give a higher coding gain while not suffering the implementation penalty
from a large value of k. If the encoder structure is a lower rate code 1/n, then there
are only 2k computations for each node at the decoding trellis, which is suitable for
practical implementations.

Program:
len = 30000; msg = randi([0 1], len, 1); % Random
data t = poly2trellis(7, [133 171]); % Define
trellis.
punctcode = convenc(msg, t, [1 1 1 0 0 1]); % Length is (2*len)*2/3.
tcode = 1-2*punctcode; % Map "0" bit to 1 and "1" bit
to -1 ncode = awgn(tcode, 3, 'measured'); % Add noise.

% Decode the punctured code


decoded = vitdec(ncode, t, 96, 'trunc','unquant', [1 1 1 0 0 1]); % Decode
[numErrP, berP] = biterr(decoded, msg); % Bit error rate

% Erase the least reliable 100 symbols, then


decode [dummy idx] = sort(abs(ncode));
erasures = zeros(size(ncode)); erasures(idx(1:100)) = 1;
decoded = vitdec(ncode, t, 96, 'trunc', 'unquant', [1 1 1 0 0 1], erasures);
%
Decode [numErrPE, berPE] = biterr(decoded, msg); % Bit error rate
fprintf('Number of errors with puncturing: %d\n', numErrP)
fprintf('Number of errors with puncturing and erasures: %d\n',
numErrPE)

47 | P a g e
48

Objective: To determine Bit Error Rate (BER) in communication over fading


channels with delay constraints.

Program:

M = 2; % DQPSK modulation order


bitRate = 50000;
hMod = modem.dpskmod('M', M); % Create a DPSK modulator
hDemod = modem.dpskdemod(hMod); % Create a DPSK demodulator
% using the modulator

% Create Rayleigh fading channel object.


ch = rayleighchan(1/bitRate,4,[0
0.5/bitRate],[0 -10]); delay =
ch.ChannelFilterDelay;

tx = randi([0 M-1],50000,1); % Generate random bit


stream dpskSig = modulate(hMod,tx); % DPSK modulate signal
fadedSig = filter(ch,dpskSig); % Apply channel effects
rx = demodulate(hDemod,fadedSig); % Demodulate signal

% Compute bit error rate, taking delay into account.


% Truncate to account for channel delay.
tx_trunc = tx(1:end-delay); rx_trunc = rx(delay+1:end);
[num,ber] = biterr(tx_trunc,rx_trunc) % Bit error rate

Output:

num =

2252

ber =

0.045

**************************************

48 | P a g e

You might also like