Digital Communications LAB: Basics of BER Calculations and Channel Models
Digital Communications LAB: Basics of BER Calculations and Channel Models
Digital Communications LAB: Basics of BER Calculations and Channel Models
DIGITAL
COMMUNICATIONS
LAB
Experiment 1
Basics of BER calculations and channel models
Introduction
This is the first experiment in the Digital Communications Lab. In this experiment, we study the most basic
method for assessing the performance of digital communication systems, the Bit Error Rate. We also study
simple models for communication channels and their effect on the communication system from the
perspective of bit error rate.
The following describes the procedure for completing MATLAB-based experiments in the digital
communication lab. Other experiments that are not MATLAB-based may have different instructions which
will be described in the DOCX documents of those experiments.
- Each experiment is graded out of 20 marks. If you sum the total grades of the lab, it would be larger
than 20. This means that you have a chance to miss some parts of the lab and still get a full mark.
o The grading is very lenient. Typically, it would be very hard to grade that is less than 16.
o Any student who does the whole lab by themselves are expected to get a grade of 18 or
more, without even getting everything right.
Cheating
Note: it is okay to talk with your friends about the experiment if you feel that you are stuck somewhere. But
please be aware that doing any of the following is considered cheating, and all involved students in these
cases are treated as cheaters:
Lab inventory
File name Description
Lab video Link: https://youtu.be/zBtf8aqwrJE
Lab1_BER.docx Contains the details of the experiment.
Lab1_script.m The main m-file containing the MATLAB script for the experiment.
GenerateBits.m
BSC.m
ComputeBER.m Additional MATLAB function files used by the experiment script file.
DecodeBitsFromSamples.
m
GenerateSamples.m
Background
The most basic target of the study of digital communications is to understand digital communication systems
and how digital information can be conveyed from a source or transmitter to a destination or receiver over a
channel. Depending on the communication systems, channels can be wired circuits, wireless channels,
satellite channels and so on. The study of digital communications begins by transforming the digital
Alexandria University جامعة اإلسكندرية
Faculty of Engineering كلية الهندسة
Electrical and Electronics Engineering قسم الهندسة الكهربية
Department 2021/2022 ,الفصل الدراسى الثاني
Spring semester, 2021/2022
communication system into an equivalent mathematical model, and then attempts to design transmitters
and receivers which achieves the target of information transmission over the channel in an efficient manner.
Figure 1 shows an example of a digital communication system. The goal of the transmitter and receiver is to
deliver the digital data from the source to the sink in the best way possible. There are several ways to define
what best mean: one of the most common and most important methods to assess the performance of a
communication system is the Bit Error Rate (BER).
Transmitter
Cha nne l
Re ce ive r
Cha nne l
Digital sink Demod ulation D/ A
decoding
Bit Error Rate (BER): the rate of error occurrences among an output sequence of bits corresponding to an
input sequence of bits.
In this experiment, we will compute the BER of different digital communication systems. These systems differ
in their respective channel models and therefore their corresponding transmitter and receiver designs.
Alexandria University جامعة اإلسكندرية
Faculty of Engineering كلية الهندسة
Electrical and Electronics Engineering قسم الهندسة الكهربية
Department 2021/2022 ,الفصل الدراسى الثاني
Spring semester, 2021/2022
Experiment
Part 1 (3 Marks)
In this part, we consider a very simple digital communication system, in which the channel takes as input
binary digits b={0,1 }, and produces the corresponding output according to the following equation.
{
y= b with probability 1−p
b with probability p
The channel described above simply flips the input bit with probability p or passes the input bit unchanged
with probability 1− p ; this channel is referred to as the Binary Symmetric Channel (BSC). The system is shown
in Figure 2. In this system, we assume that the transmitter takes the input bits coming from the source and
passes them unchanged to the channel (i.e., the transmitter does nothing). However, we would like to
investigate how the receiver can be designed to produce a good BER.
Transmitter
Digital Receiver
Channel Digital sink
source
Your goal in this task is to design the receiver. You know that the channel takes the data, flips it randomly
(with probability p) and gives you the output. What would the receiver do with that output?
Think about the following two receivers and say what is the expected performance of these receivers. As a
hint to start, these two receivers are not very good.
Example 1: the receiver gives a 0 bit as output. This output does not depend at all on what the channel is
giving out.
Questions
What is the corresponding BER Suppose we have a sequence of (N) bits including (E) bits of ones
for that receiver? You do not BER = number of ones in the data / total number of bits
need to implement it in the m- BER = E / N
file to answer.
What is the reason behind the
performance of this receiver?
Example 2c, i.e., 0s and 1s with a probability of 0.5. Again, this output is not based on what the channel is
giving out.
Alexandria University جامعة اإلسكندرية
Faculty of Engineering كلية الهندسة
Electrical and Electronics Engineering قسم الهندسة الكهربية
Department 2021/2022 ,الفصل الدراسى الثاني
Spring semester, 2021/2022
Questions
What is the corresponding BER Suppose we have a sequence of (N) bits including (O) bits of ones
for that receiver? You do not and (Z) bits of zeros
need to implement it in the m- BER = (0.5 * O + 0.5 * Z) / N = 0.5 * (O + Z) / N = 0.5 * N / N
file to answer. BER = 0.5
What is the reason behind the
performance of this receiver?
The above two receivers are examples of receivers which clearly would not be considered as good receivers
from a BER perspective (why?). In the following part of the experiment, you would design the best receiver
and assess its performance by computing the corresponding BER.
EXP. Complete PART 1 in the experiment M-file Lab1_script.m and the missing implementation of all
included functions. Then answer the following questions:
Questions
What is the corresponding BER
for receivers 1 and 2 above? You
do not need to implement the
two receivers to answer.
What is the reason behind the
performance of these two
receivers?
What is the BER of the best
receiver?
Part 1-a (2 Marks)In this part, we study the impact of the BSC channel
parameter p on the BER of the digital communication system. Namely,
we vary the value of p from 0 to 1, and for each value of p we compute
the corresponding BER, we save these values in an array, then, later on
in Part 3-a, plot the values of BER versus their corresponding parameter
value p.
EXP. Complete PART 1-a in the experiment M-file Lab1_script.m. The final figure containing the required
plot will be generated at the end of Part 3-a of the experiment.
Part 2 (3 Marks)
In this part, we again consider the system proposed in Figure 2 but we try to improve the transmitter a bit.
Namely, the transmitter works as follows: for each input bit b , the transmitter generates a set of 5 copies of
the bit b which are then passed sequentially through the channel. Note that this behavior leads to the
increase in the number of bits being passed through the channel (is that good or bad?). The system is shown
in Figure 3. For this transmitter, the receiver expects to receive a sequence of 5 channel outputs, all
Alexandria University جامعة اإلسكندرية
Faculty of Engineering كلية الهندسة
Electrical and Electronics Engineering قسم الهندسة الكهربية
Department 2021/2022 ,الفصل الدراسى الثاني
Spring semester, 2021/2022
corresponding to the same input bit. Therefore, we expect that the receiver can use these outputs for a
better decoding performance. In this part, we investigate how to design the best receiver and the
corresponding BER performance.
Transmitter
Digital Receiver
Channel Digital sink
source
Figure 3 A digital communication system with a Binary Symmetric Channel and a modified transmitter
EXP. Complete PART 2 in the experiment M-file Lab1_script.m and the missing implementation of all
included functions. Then answer the following questions:
Questions
What is the BER of the best
receiver?
What is the expected
(theoretical) BER if the number
of repetitions is increase to 10?
What is the cost/downside of
using the transmitter in Part 2?
EXP. Complete PART 2-a in the experiment M-file Lab1_script.m. The final figure containing the required
plot will be generated at the end of Part 3-a of the experiment.
Part 3 (3 Marks)
In part 3, we consider the same system in Part 2. However, the channel in Part 3 generates correlated
outputs among the 5 transmitter outputs that correspond to the same input bit. For example, for a 0 input bit
to the transmitter and a corresponding five copies of the bit 0, the channel output either generates a set of
five 0’s with probability 1− p or a set of five 1’s with probability p. In this case, we investigate the design of
the best receiver and the corresponding BER.
EXP. Complete PART 3 in the experiment M-file Lab1_script.m and the missing implementation of all
included functions. Then answer the following questions:
Questions
What is the BER of the best
receiver?
Alexandria University جامعة اإلسكندرية
Faculty of Engineering كلية الهندسة
Electrical and Electronics Engineering قسم الهندسة الكهربية
Department 2021/2022 ,الفصل الدراسى الثاني
Spring semester, 2021/2022
EXP. Complete PART 3-a in the experiment M-file Lab1_script.m. The final figure containing the plots from
all three parts can now be generated. Please add the generated plot in the box below.
Questions
Which of the three systems have
the best performance in terms of
BER?
If the receiver you designed in
any of the previous parts attain a
BER more than 0.5, how can it be
changed to attain a maximum of
0.5 BER?
Part 4 (8 Marks)
In this part, we go back to the system considered in Part 2, namely the system with a transmitter which
generated a set of 5 repetitions to the input bit. Now, we would like to investigate the effect of changing the
number of repetitions on the decoding performance. You need to generate a figure where the x-axis shows
the number of repetitions, and the y-axis shows the corresponding BER. In this part, you can consider p = 2.
EXP. Write your own code in PART 4 in the experiment M-file Lab1_script.m. Your code should generate a
figure as described in the discussion above.