Wireless Comm Lab Manual - Yash
Wireless Comm Lab Manual - Yash
Wireless Comm Lab Manual - Yash
MORBI-2
LAB MANUAL
Wireless Communication
(3171608)
CERTIFICATE
_____________ _____________
Head of Department Faculty
2
Sr.
No. Definition Date Signature Remarks
8
To stimulate wireless channel including Rayleigh
Fading using SCILAB
9 To stimulate Orthogonal Frequency Division
Multiplexing (OFDM) using SCILAB
EXPERIMENT: 1
INTRODUCTION TO SCILAB
Aim:
To Briefly introduction about SCILAB.
3
Theory:
INTRODUCTION TO SCILAB:
The useful workspace in Scilab consists of several windows:
The console for making calculations,
• The editor for writing programs,
• The graphics windows for displaying graphics,
• The embedded help.
The general environment and the console
After double-clicking the icon to launch Scilab, Scilab environment by
default consists of the following docked windows – console, files and
variables browsers, command history.
In the console after the prompt “ --> “, just type a command and press the
Enter key on the keyboard to obtain the corresponding result.
4
--> 57/4
ans = 14.25
--> (2+9)^5
ans =
161051.
It is possible to come back at any moment with the keyboard's
arrow keys ← ↑ → ↓ or with the mouse. The left and right keys
are used to change the instructions and the up and down keys are
used to come back on a previously executed command.
SQRT
ans = 0.0060699
The tab key →│ on the keyboard can be used to complete the name of
a function or a variable by giving its first few letters.
For example, after typing in the console the command:
-->fact
6
and then pressing the tab key, a window is displayed with all the
functions and variables names beginning with fact, such as
factorial and factor. Just double click on the required function or
select it with the mouse or with the keys ↑ ↓ and press Enter
(Windows and Linux) or Return (Mac OS X) to insert it in the
command line.
• The command history allows you to find all the commands from
previous sessions to the current session.
• The variables browser allows you to find all variables previously used
during the current session.
1.1.4 Edit
7
1.1.5 Control
The editor
Typing directly into the console has two disadvantages: it is not
possible to save the commands and it is not easy to edit multiple
lines of instruction. The editor is the appropriate tool to run
multiple instructions.
1.1.6 Opening the editor
To open the editor from the console, click on the first icon in the
toolbar or on Applications > SciNotes in the menu bar.
The editor opens with a default file named “ Untitled 1“.
1.1.7 Writing in the editor
8
• (,[,…
• if, function,…
1.1.8 Saving
10
1.1.10 Modifying a plot
11
To access the online help, click on ? > Scilab Help in the menu bar, or
type in the console:
-->help
To get help with any function, type help in the console followed
by the name of the appropriate function. For example:
-->help sin displays help for sin
(sine) function.
13
14
EXPERIMENT: 2
Aim:
Write a program to calculate cluster size N for given value of signal to
interference ratio.
Program:
clc;
clear all;
SIRdb=input('Enter the SIRdb=');
SIR=10^(SIRdb/10)
N=input('Enter the number of cell per cluster, N=');
i=input('Enter the number of cochannel cells,i=');
n=input('Enter the path loss exponent,n=');
N=(1/3)*((SIR*i)^(2/n)) if N > 1 && N <=3
N=3; elseif N >3
&& N<=7
N=7; elseif N>7
&& N<=12
N12; elseif
N>12 && N<=13
N=13
; end; N
//for this value of N the given SIR is obtained or not
SIRnew=(sqrt(3*N)^n)/i
SIRnewdb=10*log10(SIRnew) if
SIRnewdb>SIRdb
disp('The new cluster size can be implemented');
end; N
15
Enter the SIRdb=20
16
EXPERIMENT: 3
Radio Propagation and Propagation PathLoss Models
Aim: Scilab code To find free space and reflected surface attenuations.
Program:
// s o l u t i o n
free_atten =(4* %pi*d/ lamda ) ^2*( Gb*Gm)^ -1;
y= round (10* log10 ( free_atten ));
disp ( “ Fr e e spa c e a t t e n u a t i o n i s %d dB nn “ ,y);
17
Aim: Scilab code To find received signal power and SNR.
Program:
d =8000; // Di s t a n c e between ba s e s t a t i o n and mobi l e s t a t i
on
f =1.5*10^9; // i n Hz lamda
=0.2; // i n me t r e s
Pt =10; //BS t r a n smi t t e d power i n wa t t s
Lo =8; // To t a l sys t em l o s s e s i n dB
Nf =5; //Mobi l e r e c e i v e r n o i s e f i g u r e i n dB
T =290; // t empe r a tur e i n d e g r e e k e l v i n
BW =1.25*10^6; // i n Hz
Gb =8; // i n dB
Gm =0; // i n dB
Hb =30; // i n me t r e s
Hm =3; // i n me t r e s
B =1.38*10^ -23; //Boltzmann “ s c o n s t a n t
// s o l u t i o n
Free_Lp =20* log10 (Hm*Hb/d ^2) ;
Pr= Free_Lp -Lo+Gm+Gb+Pt; // i n dBW
Te=T *(3.162 -1) ;
Pn=B*( Te+T)*BW;
disp ( “ Re c e ived s i g n a l power i s %d dBW nn “ ,10* log10
18
(Pn));
Output:
Program:
d =3*1000; // i n me t r e s
Y =4; // path l o s s exponent
Pt =4; // Transmi t t ed power i n wa t t s f
=1800*10^6; // i n Hz Shadow =10.5; // i n
dB d0 =100; // i n me t r e s
P0 = -32; // i n dBm
19
disp ( “ Al l owabl e path l o s s i s %. 1 f dB nn “ ,
path_loss );
Aim: Scilab code to find the distance between transmitter and receiver.
Program:
shadow =10; // i n dB Lp
=150; // i n dB
Output:
20
EXPERIMENT: 4
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:
• Transmitter power.
• Antenna 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.
21
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.
Program:
clc; close
all;
clear all; pi=3.14;
// Boltzman Constant K = -228dBW/K/hz
// Satellite at 40,000Km distance from Earth station
// Satellite Antenna Gain = 31dB
// Receiver System Noise Temp = 500K
// Transponder saturated output Power = 80W
// Earth Station Antenna Diameter = 5m
// Earth Station Aperture Efficiency = 68//
// Uplink Frequency = 14.15Ghz
// Required C/N in transponder = 30dB
// Transponder HPA Output Backoff = 1 dB
// Location: -2dB contour of satellite receiving antenna
// Downlink Frequency = 11.45Ghz
22
// Receiver IF Noise BW = 43.2Mhz
// Antenna Noise Temp = 30K
// LNA Noise Temp = 110K
// Required Overall (C/N)o in clear air = 17dB
CNup=30:1:60; //C/N required at transponder is 30dB
ln=length(CNup); // Uplink Noise Power Budget
k=-228.6; // Boltzman Constant
T1=500;
Output:
24
EXPERIMENT: 5
Aim: To write a SCILAB 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.
25
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:
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;
26
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:');
ch=0.8+(1.1*log10(f)-0.7)*Hm-1.56*log10(f); 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-
6.55*log10(Hb))*log10(d); disp(sprintf('%s %f %s','Path
loss in Urban Areas=',Lu,'db')); Output:
27
28
EXPERIMENT: 6
Concepts
1. What is Multipath?
2. Effect of Multipath on the performance of CDMA
3. What is RAKE Receiver? Description
What is Multipath?
Multipath occurs when a radio signal is split into two or more signals
causing the receiving antenna to receive multiple copies of the same
signal. The radio signal can be split by obstacles such as walls, chairs,
tables and other objects. As the signal bounces off an object it causes a
longer path to the receiver. Some signals may bounce off several
objects before reaching the receiver. The longer the path, the greater
the amount of delay. As radio signals are delayed, they reach the
receiving antenna at different times sometimes overlapping. The
receiver becomes confused by the signals and is unable to interpret
them correctly which causes data errors requiring retransmission of the
signal. Performance can be significantly reduced by the delayed
signals and retransmissions.
29
the equivalent number of users in the cell, as it increases the amount of
interference seen by the receiver. RAKE Receiver
A RAKE receiver is a radio receiver designed to nullify the effect of
multipath fading. It uses number of sub-receivers called fingers. Each
finger is a correlator and is designed to a different multipath
component. Each finger independently decodes a single multipath
component. The output of all the correlators is combined to increase
the SNR in a multipath environment. The multipath channel through
which a radio wave transmits can be viewed as transmitting the line of
sight wave plus a number of multipath components. Multipath
components are delayed copies of the original transmitted wave
traveling through a different echo path, each with a different
magnitude and time of arrival at the receiver. Since each component
contains the original information, if the magnitude and phase of each
component is computed at the receiver through a method called
channel estimation then all the components can be added coherently to
improve the information reliability. The RAKE receiver is so named
because it looks like a garden rake, each finger collecting the symbol
energy similar to how the fingers in a garden rake collects leaves. To
minimize the distortions introduced in the DS- CDMA systems, RAKE
receiver uses a technique called diversity.
RAKE Receiver
30
In our case, RAKE receiver has 2 fingers. Each finger of the receiver
process one path of the composite multipath signal. All the processing
in the RAKE fingers should be done at chip level. Here c(k)indicates
the spreading code used for that particular user. h0and hLare the
multipath channel coefficients. LTcis the delay that is used in the
multipath channel model.
31
Receiver
1. The samples are received from the WiCOMM-T Rx interface block
2. The received samples are down sampled
3. The down sampled signals are de-spreaded using User1 de-
spreading codes using MRC and EGC technique
4. The de-spreaded data are QAM demodulated for both MRC and
EGC.
5. BER is calculated for the QAM demodulated data for both MRC
and EGC.
Procedure
Note: Refer Appendix A on how to setup WiCOMM-T and Appendix B
on how to generate the modem samples, vary the parameters,
transmit, receive and analyzing the received modem samples etc.
The following are the default values used for this experiment.
1. Connect WiCOMM-T for baseband loop back.
32
2. Select CDMAPART2 from the experiments list in EXPERIMNT
window.
3. Select the SNR maximum and minimum value from pop up menu
for generating the transmitter modem sample.
EXPERIMENT: 7
33
Aim: To study the BER performance of MRC is combining and equal
combining varying with SNR.
Description
Bandwidth Sharing
If the proper modulation codes are selected, it is feasible to have
multiple pairs of receivers and transmitters occupying the same
bandwidth
Security
Immunity to Interference
If an external radio signal interferes with the spread spectrum signal, it
will be rejected by the demodulator much as random noise and hence
provide excellent error rate even with faint signals.
Spreading codes
The spreading code or the PN sequence should be ideally balanced
with equal number of ones and zeros over the length of the sequence as
well as cryptographically secure. Some of the most popular PN
sequences are Barker, M – Sequence, Gold and Walsh. More complex
sequences provide a more robust link but the implementation becomes
very expensive. We have Orthogonal spreading codes, Non-Orthogonal
spreading codes and Mixed spreading codes. Orthogonal codes are
generated using Walsh-Hadamard series and the Non-orthogonal codes
are generated using Linear Feedback Shift Register (LFSR).
35
The mixed codes are generated by multiplying the orthogonal and
nonorthogonal codes. The orthogonality property of the orthogonal
codes is very important for any communication system. Because of the
orthogonality property, two orthogonal signals can be transmitted at
the same time and will not interfere with each other. But the auto
correlation function of the Walsh – Hadamard matrix can have more
than one peak and therefore it is not possible for the receiver to detect
the beginning of code word without an external synchronization
scheme. Also the cross correlation can also be non-zero for a number
of time shifts and un- synchronous users can interfere with each other.
The spreading is not over the entire bandwidth instead it is over a
number of discrete frequency component. Orthogonality is affected by
multi-path effect.
Gold sequences are popular for Non-orthogonal codes. Here the
transmission can be asynchronous. The receiver can synchronize using
the auto correlation property of the Gold Sequence.
36
Non-Orthogonal Spreading Code
To give up the orthogonality property among users and to reduce the
interference between users by using spread spectrum technique, Non-
orthogonal spreading codes are used. Non-orthogonal codes are
generated using LFSR method. The LFSR is a shift register whose
input bit is a linear function of the previous state. The initial value of
the LFSR is called Seed. It has number of flip-flops termed as
registers. For the feedback mechanism the bits contained in the
selected positions in the shift registers are XORed and then fed as
input to the first shift register. The bit positions selected for feedback is
termed as taps. The Linear Feedback Shift Register is shown below. If
the length of the LFSR is taken as n then the repetition rate of the PN
sequence generated will be 2n-1. The repetition rate is 2n-1 because if
the contents of all the registers are zero then the shift registers won’t
change their states. So the condition of all zeros in the PN sequence
output is forbidden. In our experiment the LFSR length is taken as 15
and hence the repetition rate of the PN sequence is 215-1 = 32767. The
initial seed is taken as 110000000100001 and the tap positions are
taken as 5,7,8,13,15. From the generated sequence any 32 length
sequence can be picked up as spreading codes. The above LFSR is
implemented in Matlab codes in our experiment.
38
nonzero cross-correlation, some part of the other user data affects the
desired user data depending on the power levels of the users.
This effect of delay is studied for three types of spreading codes
discussed earlier. The delayed arrival of one user with respect to the
other user is done by introducing delay between two users. It is
observed that the mixed codes have a better constellation plot than the
other two codes.
SCILAB Code Implementation Transmitter
40
Chip length = 32
Samples per symbol = 8
Data length = 12
No of frames = 10
Sync sequence length = 800
Spreading code : Orthogonal
Delay : zero
User Power level : User1 as one & User2 as zero.
• Connect WiCOMM-T in baseband loop back.
• Select CDMAPART1 from the Experiments popup menu in
EXPERIMENT window.
• Choose the orthogonal spreading code.
• Keep the power of User1 (A1) as 1 and power of User2 (A2) as 0
for single user condition.
• Generate the transmitter modem sample.
• Transmit and receive the modem sample through WiCOMM-T.
7. Analyze the received modem samples.
8. Observe the various plots generated by MATLAB and tabulate the
BER Value.
9. Introduce delay between two users.
10. Vary the power of User1 and User2 and repeat steps 5 to 8.
11. Change the spreading code to Non-orthogonal & Mixed code and
repeat steps 3 to 10.
12. Connect WiCOMM-T in IF loop back.
13. Repeat steps 2 to 11 for IF loop back 14. Connect 2 WiCOMM-Ts
in baseband level.
15. Repeat steps 2 to 11 for baseband communication
16. Connect the 2 WiCOMM-Ts in IF level
17. Repeat steps 2 to 11 for IF communication
EXPERIMENT: 8
Theory:
//----------Input Section------
N=1000000;// Number of samples to generate
Variance= 0.2; // Variance of underlying Gaussian random variables
//
//Independent Gaussian random variables with zero mean and unit
variance x=rand(1, N); y = rand(1, N);
//Rayleigh fading envelope with the desired variance r=
sqrt(Variance*(x.^2+y.^2));
42
//Define bin steps and range for histogram plotting step=0.1;
range=0:step:3;
//Get histogram values and approximate it to get the pdf curve
h=histplot(r,range);
Stimulation Waveform
43
Result: The program for Wireless channel – Rayleigh Fading was
simulated successfully.
44
EXPERIMENT: 9
Theory:
In telecommunications, the orthogonal frequency - division
multiplexing (OFDM) is a type of digital transmission and a method of
encoding digital data on multiple carrier frequencies. OFDM has
developed into a popular scheme for wideband digital communication,
used in applications such as digital television and audio broadcasting,
DSL internet access, wireless networks, power line networks. and
4G/5G mobile communications. The main advantage of OFDM over
single-carrier schemes is its ability to cope with severe channel
conditions (for example, attenuation of high frequencies in a long
copper wire, narrowband interference and frequency selective fading
due to multipath) without complex equalization filters. Channel
equalization is simplified because OFDM may be viewed as using
many slowly modulated narrowband signals rather than one rapid
modulated wideband signal.
The low symbol rate makes the use of a guard interval between
symbols affordable, making it possible to eliminate intersymbol
interference (ISI) and use echoes and time spreading (in analog
television visible as ghosting and blurring, respectively) to achieve a
diversity gain, i.e., a signal-to-noise ratio improvement. This
mechanism also facilitates the design of single frequency networks
(SFNs) where several adjacent transmitters send the same signal
simultaneously at the same frequency, as the signals from multiple
distant transmitters may be re-combined constructively, sparing
interference of a traditional single-carrier system.
46
z = reshape (z.',prod (size (z)),1); //matrix to vector conversion
[noe, ber] = biterr (x,z); //BER calculation figure; figure;
subplot (211); stem (x (1:256)) ;title('Original Message');
subplot (212); stem (z (1:256)) ;title ('recovered Message');
Stimulation Waveform
47
48
Result:
The program for Orthogonal Frequency Division Multiplexing
(OFDM) was simulated successfully.
EXPERIMENT: 10
Aim:
To study Gaussian Minimum Shift Keying (GMSK) modulation
technique
To design a receiver using Viterbi algorithm
To study the BER using Viterbin
49
Theory
• GMSK modulation
• Why GMSK modulation for GSM
• GMSK signal generation
• GSM transmitter
• GSM Receiver using Viterbi
Description
GMSK Modulation
Offset QPSK (OQPSK) is obtained from QPSK by delaying the Q data
stream by 1 bit with respect to the I data stream. MSK is derived from
OQPSK by replacing the rectangular pulses in amplitude with a half
cycle sinusoidal pulse. MSK modulation makes the phase change
linear and limited to +π /2 over a bit interval of T. Because of this
linear phase change, the power spectral density has low side lobes that
help to control adjacent channel interference. In MSK when the half
sinusoidal pulse is replaced by Gaussian Pulse shape then the
modulation is Gaussian Minimum Shift Keying (GMSK)
GSM Transmitter
Each GSM transmitter frame consists of 156.25 symbols. Six such
frames constitute a hyper frame. Ten hyper frames repeated one after
the other constitute the transmitted information. Total number of
samples transmitted is N samples = 8 x 156.25 x 6 x 10 = 75000. The
frame structure of the GSM transmitter consists of first 2 frames for
the identification. They are the FCCH (Frequency Control Channel)
and the SCH (Synchronization Channel). The remaining 4 frames carry
the actual data to be transmitted.
• The FCCH consists of a 148 '0' bits followed by 8.25 random guard
bits. It is mainly used to estimate the frequency difference between
received and transmitted frequencies S4(n).
• The SCH channel has a known 64 bit sequence with good
correlation properties. Hence this channel is used for frame
synchronization. (In our case we use the whole SCH frame for
synchronization) • The traffic channel contains the data to be decoded.
GSM Receiver
51
highly complex. Here for bit recovery Viterbi algorithm is used
Frequency Synchronization Take samples of the received data, and
calculate the FFT. The difference between the most dominant
frequency component of the transmitted and received spectrum will
give us the frequency offset between the transmitter and receiver.
Necessary corrections are performed on the received data.
Frame Synchronization
Correlate the received data with the actual transmitted SCH channel
and look for the peaks. The location of peak helps in identifying the
beginning of the SCH channel.
The beginning of the
FCCH and the traffic channels are also identified.
54
Procedure
Note: Refer Appendix A on how to setup WiCOMM-T and Appendix B
on how to generate the
modem samples, vary the parameters, transmit, receive and analyze the
received modem samples etc.
1. Connect WiCOMM-T in baseband loop back with the sampling rate
set to 2MBps.
2. Generate the transmitter modem sample.
3. Transmit and receive the modem sample through WiCOMM-T and
analyse the received modem samples.
4. Observe various plots generated by SCILAB.
5. Connect WiCOMM-T in IF loop-back and repeat steps 2 to 4
6. Connect 2 WiCOMM-Ts such that one as transmitter and other as
receiver in baseband and in IF and repeat steps 2 to 4
Note: For running this experiment between two WiCOMM-Ts such
that one will be transmitter and other will be receiver, ‘bits.bin’,
generated by transmitter SCILAB file under ‘C:\WiCOMM-
T\EXPERIMENTS\GMSK\REF_Data’ directory should be copied to
receiver ‘C:\WiCOMM-
T\EXPERIMENTS\GMSK\REF_Data’ directory since receiver
SCILAB code refers ‘bits.bin’ file for synchronization & BER
calculation.
Result:
Thus, the experiment was performed successfully.
55