Professional Documents
Culture Documents
Name ID
1. YordanosAdeme 1103056
2. TsegaMelese 1103290
3. TsionTesfaye 1103213
4. Wubegzer Lake 1102205
5. Yalemtibeb Addis 1103307
6. Fikresilassie Endalkachew 1102639
7. Mastewal Tibeb 1102443
8. Tesfalem Temesgen 1102510
9. Tibeb Getnet 1102700
Table of Contents
Part I............................................................................................................................................................3
Simulation of Wireless Communication Systems.........................................................................................3
Introduction.............................................................................................................................................3
Practical 1.1: Binary Random Data Generation..........................................................................................4
Theory.....................................................................................................................................................4
Practical 1.2: Digital Modulation of the Binary Random Data.....................................................................6
Theory.....................................................................................................................................................6
Modulation Techniques...........................................................................................................................6
Quadrature Amplitude Modulation (QAM).............................................................................................8
Plotting the Signal Constellation of this Modulator.................................................................................9
Annotate the Plot to Indicate the Mapping...........................................................................................10
Gray coded the modulator to minimize error............................................................................................11
Practical 1.3: Wireless Channel Modeling.................................................................................................12
Theory...................................................................................................................................................12
Creating the Wireless Channel Objects..................................................................................................14
Practical 1. 4: Adding the Effect of the Additive White Gaussian Noise (AWGN)......................................16
Theory...................................................................................................................................................16
Practical 1.5: Demodulation of the Received Signal..................................................................................18
Theory...................................................................................................................................................18
Practical 1.6: Compare the Bit Error Rate (BER) of the System..................................................................18
Theory...................................................................................................................................................18
Practical 2.1: Planning and Creating the Cells and Base Stations...............................................................19
Creating the Base Stations.....................................................................................................................23
Practical 2.2: Creating and Adding the Mobiles to the Cellular System.....................................................23
I
WIRELESS LAB REPORT
Part I
Simulation of Wireless Communication Systems
Introduction
The practical exercises covered in this lab session on wireless and mobile communication
systems are extremely basic and helpful in understanding the subject's main goal. These
applications strengthen the theoretical and practical ideas that engineering students find to be of
utmost importance. The themes of wireless and mobile communication systems, which are
created to be developed using Matlab software, are covered practically in this workbook. This
workbook mostly includes a pertinent documentation of the lab sessions.
Objectives
The objective of this laboratory is to understand the various parts of the wireless communication
systems and observe the related modulation quality measurements. As we progress, the students
will be familiar with the following basic concepts.
1
WIRELESS LAB REPORT
Function Used
randint();
stem();
hist();
Code
% Generate the random data using the signal source % Create a binary data stream as a column
vector and plot thefirst50 bits in a stem plot.
n=3e4;
x = randint(n,1); % Random binary data stream from the source figure(1) stem(x(1:50),'filled');
title('Random Bits');
xlabel('Bit Index');
ylabel('Binary Value');
n=3e4;
x = randint(n,1);
% Random binary data stream from the source figure (1) stem(x (1:50),'filled'); title ('Random
Bits'); xlabel('Bit Index'); ylabel('Binary Value');
2
WIRELESS LAB REPORT
% used to convert the bits in x into k-bit symbols. % Reshape(x,m,n) returns the m-by-n matrix
% whose elements are taken column wise from x. % An error results if X doesn’t have M*N
elements. M=16; k=log2 (M); x1=reshape(x,k,length(x)/k).';
3
WIRELESS LAB REPORT
In most media for communication, only a fixed range of frequencies is available for
transmission. One way to communicate a message signal whose frequency spectrum does not fall
within that fixed frequency range, or one that is otherwise unsuitable for the channel, is to alter a
transmittable signal according to the information in your message signal. This alteration is called
modulation and it is the modulated signal that you transmit. The receiver then recovers the
original signal through a process called demodulation.
Modulation Techniques
The methods of modulation depend on whether the input signal is analog or digital. The table
below show the modulation techniques that Communication Toolbox software supports for
analog and digital signals respectively.
4
WIRELESS LAB REPORT
The Nyquist sampling theorem requires that the sampling rate, fs, should be greater than two
times the sum of the carrier frequency and the highest frequency of the modulated signal in order
for the demodulator to recover the message correctly.
The basic procedure for modulating a signal with MPSK and MQAM involves the following
steps:
2. Adjust properties of the modulator object, if necessary, to tailor it to your needs. For
example, you can change the phase offset or symbol order.
3. Modulate your signal by applying the modulate method of the modulator object, as
described in the following section.
Similarly the basic procedure for demodulating a signal with MPSK and MQAM involves the
following steps:
2. Adjust properties of the demodulator object, if necessary, to tailor it to your needs. For
example, you can change the phase offset or symbol order.
3. Demodulate your signal by applying the demodulate method of the demodulator object,
as described in the following section.
Quadrature Amplitude Modulation (QAM)
In this laboratory, we will use QAM techniques that you have learnt in digital communication.
Modulate Using MQAM: having defined xsym as a column vector containing integers between 0
and M where M is the alphabet size and must be an integer power of two. The message signal
must consist of integers between 0 and M-1. Therefore, if the random source is in binary, we
must preprocess the binary data stream x before using the modulate method of the object. In
particular, you arrange each tuple of values from x across a row of a matrix, using the reshape
function in MATLAB, and then apply the bi2de function to convert each k-tuple to a
corresponding integer.
Function Used:
modem.qammod();
5
WIRELESS LAB REPORT
modem.qamdemod();
Define the Modulating Object
Generally we use the modulation object that we have shown in the tables 1.1 and 1.2 above to
modulate the signal. In this case, we can change the property of the modulation parameters
according to our design specifications. The command: hmod = modem.qammod (M)
Constructs a QAM modulator object hmod for M-ary modulation. The properties that are unique
to the QAM modulator object are set to default values. A QAM modulator object has the
following properties. All the properties are writable except for the ones explicitly noted
otherwise.
Type: - Type of modulation object ('QAM Modulator'). This property is not writable.
M: - M-ary value.
Phase Offset - Phase offset of ideal signal constellation in radians.
Constellation- Ideal signal constellation. This property is not writable and is
automatically computed based on M and Phase Offset properties.
Symbol Order- Type of mapping employed for mapping symbols to ideal constellation
points. The choices are:
Gray mapping is a modulation technique in which the corresponding adjacent bits sequences are
differ by one bit. This mapping technique is used to reduce the probability of BER in the
communication system. For the PSK, DPSK, FSK, QAM, and PAM modulation types, Gray
constellations are obtained by selecting the Gray parameter in the corresponding modulation
function or method. For modulation objects, you can set the symbol order property to Gray to
obtain Gray-encoded modulation.
6
WIRELESS LAB REPORT
Symbol Mapping: Symbol mapping is a list of integer values from 0 to M-1 that correspond to
ideal constellation points. This property is writable only when Symbol Order is set to 'user-
defined'; otherwise it is automatically computed.
Input Type: - Type of input to be processed by QAM modulator object. The choices are:
M= 16; %Numberofpointsinconstellation
h=modem.qammod(M); %
Modulator object mapping=h.SymbolMapping
% Symbol mapping vector pt = h.Constellation; % Vector
of all points in constellation
7
WIRELESS LAB REPORT
(That is, if it were a Gray-coded signal constellation, then the annotations for each pair of
adjacent points would differ by one bit.). Figure below shows Gray-coded 16QAM signal
constellation.
8
WIRELESS LAB REPORT
Code
modem.qammod('M',M,'SymbolOrder','Gray');
% Plot the constellation. % Include text annotations that number the points. text(real(pt)
+0.1,imag(pt),dec2b in(mapping)); axis([-4 4 -4 4]); % Change axis so all labels fit in plot.
Modulator objects have a method modulate that is used to modulate signals. The syntax is y =
modulate (h, x), where h is the handle to a modulator object and x is a signal. When mapping
input bits to symbols, the first bit is interpreted as the most significant bit. For h.inputtype = `bit'
(i.e., x represents binary input), nBits consecutive elements in each channel or column represent
a symbol, where nBits =log2 (M). For h.inputtype = `integer' (i.e., x represents symbol input),
elements of x must be in the range [0, M-1].
9
WIRELESS LAB REPORT
❖The maximum Doppler shift is computed as v*f/c, where v is the mobile speed, f is the carrier
frequency, and c is the speed of light. For example, a maximum Doppler shift of 200 Hz (as
above) corresponds to a mobile speed of 30 m/s and a carrier frequency of 2 GHz.
❖By convention, the delay of the first path is typically set to zero. For subsequent paths, a 1
microsecond delay corresponds to a 300 m difference in path length. In some outdoor multipath
environments, reflected paths can be up to several kilometers longer than the shortest path. With
the path delays specified above, the last path is 3.6 km longer than the shortest path, and thus
arrives 12 microseconds later. Together, the path delays and path gains specify the channel's
average delay profile.
❖Typically, the average path gains decay exponentially with delay (i.e., the dB values decay
linearly), but the specific delay profile depends on the propagation environment. In the delay
profile specified above, we assume a 3 dB decrease in average power for every 4 microseconds
of path delay. The Doppler shift of the specular component is typically smaller than the
maximum Doppler shift (above) and depends on the mobile's direction of travel relative to the
direction of the specular component. The K-factor specifies the linear ratio of average received
power from the specular component relative to that of the associated diffuse components.
In this laboratory we will use these types of fading channel distribution. To process a signal
using a fading channel involves the following steps:
10
WIRELESS LAB REPORT
❖Create a channel object that describes the channel that you want to use. A channel object is a
type of MATLAB variable that contains information about the channel such as the symbol
period, maximum Doppler shift, multipath component and other parameter.
❖Adjust properties of the channel object, if necessary, to tailor it to your needs. For example,
you can change the path delays or average path gains.
❖Apply the channel object to your signal using the filter function, which has been overloaded to
work with channel objects.
Functions Used
The following variables control both the Rayleigh and Rician channel objects. By default, the
channel is modeled as four fading paths, each representing a cluster of multipath components
received at around the same delay.
Code
Ts= 1/500000;
% Rican k-factors
11
WIRELESS LAB REPORT
The wireless channel is considered as the linear time variant channel. Thus after we create the
wireless channel object and adjust the parameters, the next step that we do is to filter the
modulate signal with the wireless channel by using the following commands:
The Communications Toolbox provides a plotting function that helps you visualize the
characteristics of a fading channel using a GUI. The channel visualization tool can be invoked by
the CHANNEL_VIS function. Using option 'IR' opens the visualization for the band limited
impulse response (green curve). The visualization also shows the delays and magnitudes of the
underlying fading path gains (red/magenta/blue stembars) clustered around the peak of the
impulse response. Components with intermediate delay values are shades between red and blue,
becoming bluer for larger delays.
'Visualization','ir'); Response
'medium'); speed
Note: In this plot, the gains may not be equal the average path gains because the Doppler Effect
causes the gains to fluctuate around their average values over time.
❖Signal-to-noise ratio (SNR) per sample. This is the actual input parameter to the AWGN
function.
❖Ratio of bit energy to noise power spectral density (Eb/N0). This quantity is used by BER
Tool and performance evaluation functions in this toolbox.
❖The relationship between Es/N0 and Eb/N0, both expressed in dB, is as follows:
13
WIRELESS LAB REPORT
❖Es/N0 (dB) = Eb/N0(dB) + 10log10 (k) where k is the number of information bits per symbol.
In a communication system, k might be influenced by the size of the modulation alphabet or the
code rate of an error-control code. For example, if a system uses a rate-1/2 code and 8-PSK
modulation, then the number of information bits per symbol (k) is the product of the code rate
and the number of coded bits per modulated symbol: (1/2) log2(8) = 3/2. In such a system, three
information bits correspond to six coded bits, which in turn correspond to two 8-PSK symbols.
The relationship between Es/N0 and SNR, both expressed in dB, is as follows:
❖ Es/N0 (dB) = 10log10 (Tsym / Tsamp ) + SNR (dB) , for complex input signals
❖Es/N0 (dB) = 10log10 (0.5Tsym / Tsamp ) + SNR (dB), for real input signals where Tsym is
the signal’s symbol period and Tsamp is the signal’s sampling period. For example, if a complex
baseband signal is oversampled by a factor of 4, then Es/N0 exceeds the corresponding SNR by
10 log10 (4).
❖Adding additive white noise to the transmitted signal that passes through the fading channel
An eye diagram is simple and convenient tools for studying the effects of inter symbol
interference and other channel impairments in digital transmission. To construct an eye diagram,
plot the received signal against time on a fixed time interval axis. At the end of the fixed time
interval, wrap around to the beginning of the time axis. The resulting diagram consists of many
overlapping curves.
yrx=txn ;
eyediagram(yrx,8);
Code
% Scatter plot of the original and noisy signal % Create scatter plot of noisy signal and
transmitted signal on the same axes. h = scatterplot(yrx(1:nsamp*5e3),nsamp,0,'g.'); hold on;
14
WIRELESS LAB REPORT
scatterplot(txc(1:5e3),1,0,'k*
The syntax is y = demodulate (h, x), where h is the handle to a demodulator object and x is a
signal. This syntax processes the binary words (bits) or symbols (integers) in signal x with the
QAM demodulator object and output the baseband signal y. The demodulator object’s property
Decision Type should be set depending on whether you want hard or soft decisions. To allow for
soft decisions, the demodulator object’s property Output Type must be set to 'bit'. In the next
section we will see the principle of QAM modulation.
Code
% Symbol-to-Bit Mapping
15
WIRELESS LAB REPORT
Practical 1.6: Compare the Bit Error Rate (BER) of the System
Theory
In communication system, the receiver side BER may be affected by transmission channel noise,
interference, distortion, bit synchronization problems, attenuation, wireless multipath fading, etc.
BER may be improved by choosing a strong signal strength (unless this causes cross-talk and
more bit errors), by choosing a slow and robust modulation scheme or line coding scheme, and
by applying channel coding schemes such as redundant forward error correction codes.
The transmission BER is the number of detected bits that are incorrect before error correction,
divided by the total number of transferred bits (including redundant error codes). The
information BER, approximately equal to the decoding error probability, is the number of
decoded bits that remain incorrect after the error correction, divided by the total number of
decoded bits (the useful information). Normally the transmission BER is larger than the
information BER. The information BER is affected by the strength of the forward error
correction code.
Code
% Compare x and z to obtain the number of errors and the bit error rate.
Conclusion
This Wireless and Mobile Communication Systems laboratory covers practical’s that are very
fundamental and quite relevant in grasping the core objective of the subject. These practical
solidify the theoretical and practical concepts that are very essential for the engineering students.
The objective of this laboratory is to understand the various parts of the wireless communication
systems and observe the related modulation quality measurements.
This laboratory report is prepared for wireless and mobile communication laboratory session.it
covers fundamental concepts on wireless and mobile communications systems which are
designed and developed on Matlab software.
16
WIRELESS LAB REPORT
Part II
(RUNE)
Practical 2.1: Planning and Creating the Cells and Base Stations
1. Introduction
Rudimentary Network Emulator is a set of Matlab functions that makes it possible to simulate
cellular networks. RUNE provides functions that handle various aspects in cellular systems that
are mobiles, base stations, propagation loss, interference and mobility.
2. Objective
3. Procedure
The first step in our cellular system simulation was to create cells. RUNE provides a function for
this purpose. It is called crecell.
17
WIRELESS LAB REPORT
plothex(xyb, fib);
The first line of the code will create three omnidirectional cells with a radius of 1000m. Then the
second line will create a plot of the three base stations.
The first input parameter to crecell is the cell radius. The second parameter is the number
of sectors per site. This will be one for omnidirectional antenna and three for sector
directional antenna.
There are three more arguments to the function crecell. They are: km, lm, and ncluster.
These parameters are used to set the reuse factor and the size of the system. km and lm
indicates the number of cells in the U and V directions and ncluster indicates the cluster
repetition.
This function returns three data structures: xyb, fib, and rhombvec where;
xyb: contains the positions of the base stations in complex numbers where the real part
represents the east-west direction and the imaginary part represents the north-south
direction.
fib: contains the position of the base station from the center of the hexagonal cell. The fib
vector contains the direction of the main lobe of the base station antenna. For each base
station position there is a corresponding direction of the main antenna lobe. The value is a
vector that points from the base station to the middle of the cell. For omnidirectional base
station the distance from the base station to the center of the cell is zero.
rhombvec: contains the size of the rhombus that represents the service area of the system
that is simulated.
18
WIRELESS LAB REPORT
The creation of a cellular system is done in two steps. First one cluster is created. The
cluster concept is closely coupled to reuse in cellular systems. One cluster contains a
number of cells and all the cells use different channels. The next step is to copy the
cluster ncluster2 times and lay the clusters out next to each other. we wrote the following
commands inorder to create and analyze the clusters.
ex_crecell(2,1); This illustrates how a cluster with N cells is built. The parameters km and lm can
be input to the function of ex_cell and here km=2 and lm=1.
19
WIRELESS LAB REPORT
par.cellradius=1000;
par.sps=1;
par.km=1;
par.lm=2;
par.ncluster=1;
figure(1);
C=[0.1, 0.6,0.3, 0.8, 0.4, 0.2,0.9]; % shows the colour of the cell
plothex(xyb,fib,C);
Practical 2.2: Creating and Adding the Mobiles to the Cellular System
The next step in the cellular system simulation is to create a number of mobiles. In RUNE,
mobiles are represented by a number of vectors in the first dimension (column vectors). Data
belonging to one mobile is found at the same position in each vector. The return vector contains
the number of mobiles (m), the mobile position (xym) and the velocity of the mobile (xyv). The
name of the vectors can of course be anything, but for simplicity they are designated as m, xym,
and xyv.
20
WIRELESS LAB REPORT
The function responsible for positioning the mobiles and moving them around is called
mobmove. The idea is that if a mobile doesn’t have a position it is given positon, and if the
mobile already has a position it can move a small distance. The reason for this is that mobmove
often work with both mobiles that have been in the system some time and new ones
simultaneously. When a mobile hasn’t been given position it is marked by setting the position
xym to nan.
Procedures
Create few mobiles and give them a position by using the commands:
nmob=10;
xym=nans(nmob,1);
xyv=nans(nmob,1);
m=(1:nmob).’;
[xym,xyv]=mobmove(xym,xyv,10,5,10,rhombvec);
plot(xym, ‘b*’);
This gives the mobile an initial position and an initial velocity. By using mobmove again the
mobile can be moved a little bit more.
[xym,xyv]=mobmove(xym,xyv,10,5,30,rhombvec);
hold on;
plot(xym, ‘r*’);
[xym,xyv]=mobmove(xym,xyv,10,5,30,rhombvec);
plot(xym, ‘g*’);
21
WIRELESS LAB REPORT
hold off;
This show, the mobile should have moved a little bit each time when we call the mobmove.
xym and xyv are the mobile position and mobile velocity.
The next two parameters are the average speed (m/s) and average acceleration (m/s2).
These parameters are used when the mobile velocity is updated.
The fifth parameter is the time step in seconds. The mobile moves a distance that is
equal to the mobile velocity multiplied by the time step.
The last argument is the rhombvec that contains the two vectors that span the area
containing the system. Mobmove needs to know the system area for two purposes:
First, it should be able to spread the mobiles evenly over the service area
Second, when a mobile already has been given the position and is moving around in the
service area.
The return vector contains the number of mobiles (m), the mobile position (xym) and the
velocity of the mobile (xyv).
Now, develop part of the simulation program that creates a number of mobiles and puts
them into the system. In many simulation program the number of mobiles is a random
quantity. Here, let assume that the program create a specific number of mobiles.
we Added the following codes on the base station code before the plot part
To Create new mobiles
par.vmean=10;
par.amean=5;
par.dt=10;
nmob=10;
xym=nans(nmob,1);
22
WIRELESS LAB REPORT
xyv=nans(nmob,1);
m=(1:nmob).’;
[xym,xyv]=mobmove(xym,xyv,par.vmean,par.amean,par.dt,rhombvec);
And then we added the following code after the plot part
hold on;
plot(xym,’b*’);
hold off;
Full code to create the mobiles with the previous base stations
To Define the cellular parameters
par.cellradius=1000;
par.km=1;
par.lm=2;
par.kn=1;
par.ln=0;
par.sps=1;
par.amean = 1;
par.vmean = 15;
par.dt = 1;
23
WIRELESS LAB REPORT
nmob=100;
xym=nans(nmob,1);
xyv=nans(nmob,1);
m=(1:nmob).';
[xym,xyv]=mobmove(xym,xyv,par.vmean,par.amean,par.dt,rhombvec);
figure(1);
clf
C=[0.1, 0.6,0.3, 0.8, 0.4, 0.2,0.9]; % shows the colour of the cell
plothex(xyb,fib, C);
hold on;
plot(xym,'b.');
hold off;
24