Digital Communications LAB: Basics of BER Calculations and Channel Models

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Alexandria University ‫جامعة اإلسكندرية‬

Faculty of Engineering ‫كلية الهندسة‬


Electrical and Electronics Engineering ‫قسم الهندسة الكهربية‬
Department 2021/2022 ,‫الفصل الدراسى الثاني‬
Spring semester, 2021/2022

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.

About the lab


The digital communications lab consists of a set of experiments which introduce essential digital
communication concepts to students. The lab consists mainly of MATLAB-based experiments in which the
students complete the required tasks of the experiment by writing MATLAB codes. Some experiments of the
lab may consist of hardware-based experiments which are performed in the digital communication
laboratory on campus.

Location of the digital communication laboratory on campus:

2nd floor, Electrical Engineering Building.

Instructions for completing the experiment


Alexandria University ‫جامعة اإلسكندرية‬
Faculty of Engineering ‫كلية الهندسة‬
Electrical and Electronics Engineering ‫قسم الهندسة الكهربية‬
Department 2021/2022 ,‫الفصل الدراسى الثاني‬
Spring semester, 2021/2022

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.

- An experiment consists of 1) a DOCX document explaining the experiment, 2) a link to a video


explaining the experiment, and 3) the MATLAB files required to complete the experiment
- Each experiment typically consists of several parts.
- The DOCX document is your starting point. It explains in detail the requirement of each experiment
part.
- The accompanying video explains the experiment. The explanation is mainly based on the
experiment DOCX.
- he MATLAB files are used by the student to complete the experiment. The main MATLAB file for the
experiment is usually named LabX_script.m with X being the experiment number. For example, the
main file for Experiment 1 would be called Lab1_script.m. This is the first file that you should open
and start working on. Inside that file, there can be referrals to other MATLAB files that you need to
complete.
- Follow the instructions in the DOCX file and the explanation video to fill the provided MATLAB files.
The experiment is completed once you generate the outcomes required in all parts of the
experiment.

Lab submission and discussion


- This experiment is due on the weeks from 12th to 24th of March.
- Please bring a printed copy of your codes and the lab DOCX with your answers in it (your answers
can be handwritten, but it is preferable to type them).
- Please submit a copy of your codes in the Assignment section on the MS Team of the course. The
time to send the codes is one minute before the start of your lab.
- There will be individual discussions with students during lab hours. Discussions will be based on the
files submitted by the students before the deadline.

Lab policy regarding grading and cheating


Grading

- 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.

Credits: Dr. Mohammed Karmoose


Alexandria University ‫جامعة اإلسكندرية‬
Faculty of Engineering ‫كلية الهندسة‬
Electrical and Electronics Engineering ‫قسم الهندسة الكهربية‬
Department 2021/2022 ,‫الفصل الدراسى الثاني‬
Spring semester, 2021/2022

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

- In exchange for this grading policy, cheating will not be tolerated.


- If a student cheats in any part in an experiment, he/she will get a zero for that entire lab.
- If a student cheats in two or more experiments, he/she will get a zero in the entire lab.
- The reason behind this policy towards cheating is the following: detecting cheating cases requires an
enormous amount of work by the instructors. Given how lenient the grading of the lab is expected to
be, there is no justification for a student to cheat (this is in addition to the fact that there is no
justification for cheating in general).

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:

- A group of students write MATLAB codes together.


- A group of students discuss the experiment together, one student of the group writes the code, and
all students use the same code.

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

Digita l Cha nne l


Modula tion A/ D
source codin g

Cha nne l

Re ce ive r

Cha nne l
Digital sink Demod ulation D/ A
decoding

Figure 1 An example of a digital communication system

Bit Error Rate (BER): the rate of error occurrences among an output sequence of bits corresponding to an
input sequence of bits.

An empirical method of computing the BER in a communication system is as follows:

1. Generate a sequence of N bits at the input side


2. Pass the sequence of input bits through the system to receive a corresponding output sequence
3. Count the number of errors in the output sequence by comparing it to the input sequence; call that
number of errors E
E
4. The BER is given by BER=
N

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

Figure 2 A digital communication system with a Binary Symmetric Channel

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?

Part 2-a (2 Marks)


Similar to Part 1-a, in this part, we study the impact of the BSC channel parameter p on the BER of the digital
communication system 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

What is the reason behind such a


performance?

Part 3-a (2 Marks)


Finally, we study the impact of the BSC channel parameter p on the BER of the digital communication system
in Part 3.

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.

Please insert the plot here

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.

Contact us if you have questions


Contact Information
Dr. Islam El Bakoury Email:
Eng. Hossam Mohammed Email:

You might also like