21TL04 WC Lab#03
21TL04 WC Lab#03
OBJECTIVES
#. Of
# Topic Taxonomy level
Lectures CLO
To analyze the BER performance of modulation
3 3 1 Knowledge C1
schemes with AWGN channel
OUTCOME(S)
RUBRICS
Page 1 of 5
DEPARTMENT OF TELECOMMUNICATION ENGINEERING
MEHRAN UNIVERSITY OF ENGINEERING & TECHNOLOGY, JAMSHORO
WIRELESS COMMUNICATIONS
(First Semester, Final Year)
Lab Experiment # 03
INTRODUCTION
At the end of this lab, you will understand the basics of communication system design by simulation
using MATLAB.
REQUIREMENTS
THEORY
It involves a data source, a modulator, a channel, a demodulator, and some logical device that receives
the data and checks if the correct data has been recovered or not.
We will work through each of the blocks shown in figure 1 and see how each block can be represented
in MATLAB.
Binary data can be generated in MATLAB using the randint( ) function or any other similar function
depending on the MATLAB version and the need of the code. The function has input arguments like
the dimensions of the matrix that it has to generate like randint(rows,cols). Usually, however, a
column vector is used to represent a stream of data. Therefore, if you want to generate a stream of
100 bits, you will have to type in
randi(1,lendatTX)
Without turning off the echo, you should see 100 samples appearing on the MATLAB command
window. To find out the size of this vector, type on the command window: size(data)
Page 2 of 5
DEPARTMENT OF TELECOMMUNICATION ENGINEERING
MEHRAN UNIVERSITY OF ENGINEERING & TECHNOLOGY, JAMSHORO
WIRELESS COMMUNICATIONS
(First Semester, Final Year)
Lab Experiment # 03
The next step is to modulate this binary data so that we can transmit it over a channel. MATLAB
provides the capacity to apply several modulation techniques like ASK, PAM, FSK, PSK, QAM, TCM etc.
These techniques are described in a complex baseband format.
To modulate a Binary PSK sequence, you can use the object ‘modem.pskmod’, which creates a
constellation for the desired modulation. To verify if the constellation has the correct constellation,
type in the following command in the command window: scatterplot(modsig).
In this experiment, we are only going to use the Additive White Gaussian Noise (AWGN) as a noise
source in the channel. It can be generated using the MATLAB function randn( ) which produced
normally distributed Gaussian random numbers with zero mean and variance equal to one. However,
to properly scale AWGN according to the Signal-to-Noise ratio, its variance is modified according to
the channel requirements.
To generate AWGN for the real/In-phase component, use the following code:
Noise = randn(1,lengthdatTX)*10.^(-SNR/20);
In order to generate AWGN for both, the real/In-phase and the imaginary/Quadrature components,
use the following code:
Where the sqrt(2) term is used to normalize the energy of the AWGN to one (addition of the two
vectors of randn( ) would have a non-unity variance)
Now, since AWGN is ‘additive’, therefore the Noise vector will add to the TxSig vector. Therefore,
Where RxSig vector contains the received signal which has the transmit signal impaired by the noise.
In order to view the constellation of the modulated symbols, type: scatterplot(RxSig)
Using a similar methodology, you are expected to complete the simulation of the
receiver/demodulator. The process would be like a mirror image of the one followed at the
transmitter. As a hint, you will need to use the following commands:
The bit error rate (BER) performance of the system can be simulated using a random bit sequence as
the modulator input and the noise produced by the channel is also random. Next, the experiment of
Page 3 of 5
DEPARTMENT OF TELECOMMUNICATION ENGINEERING
MEHRAN UNIVERSITY OF ENGINEERING & TECHNOLOGY, JAMSHORO
WIRELESS COMMUNICATIONS
(First Semester, Final Year)
Lab Experiment # 03
transmitting data and then receiving it is repeated for a reasonable number of times. The more it is
repeated, the better and ‘accurate’ the results would be.
After you create the de-modulator, use ‘biterr’ function to find the number of bits received different
from those transmitted. If there is a difference, then there is supposed to be an erroneous reception
and thus bit error.
The performance of the system can be measured using the BER vs Eb/No (energy-of-bit-to-noise)
ratio. For this, you need to put a loop around the code you write for the communication system based
on the values of Eb/No (something like Eb/No = [0:20]). Make sure that the bits in error for each
value of Eb/No is stored as a vector so that you can plot (using semilogy() ) against Eb/No.
LAB TASKS
1. Write a MATLAB program for 8-PSK, 32 QAM and 64 QAM modem and attach constellation
diagrams. Attach all working codes too.
2. Plot and elaborate the Eb/No vs BER curve for the techniques mentioned in above task 1.
3. Simulate the schemes mentioned in Activity 1 using Simulink and perform Activity 2 on the
obtained results.
Page 4 of 5
DEPARTMENT OF TELECOMMUNICATION ENGINEERING
MEHRAN UNIVERSITY OF ENGINEERING & TECHNOLOGY, JAMSHORO
WIRELESS COMMUNICATIONS
(First Semester, Final Year)
Lab Experiment # 03
REVIEW QUESTIONS
1) What are the effects of SNR on the constellation of PSK and QAM symbols?
2) How much SNR would be required to support video and audio services for the modulation
techniques mentioned in Lab task 1.
3) What is the Monte Carlo method? What are its benefits and drawbacks?
Page 5 of 5