You are on page 1of 71

Mobile Communications

Engr. Naveed Jan


College of Engineering
CECOS University of IT & Emerging Sciences
CECOS University of IT & Emerging Sciences 2
CECOS University of IT & Emerging Sciences 3
CECOS University of IT & Emerging Sciences 4
CECOS University of IT & Emerging Sciences 5
To determine whether an error control scheme is justified for a
particular application, the following factors need to be
considered:

1) Transmission channel characteristics


2) Decoding performance
3) Nature of message format
4) Speed of the codec operation
5) Coding redundancy
6) Availability of a feedback channel
7) Delay throughput
8) Location of the codec in the transmission link and code
transparency
9) Complexity and cost

CECOS University of IT & Emerging Sciences 6


Assignment: 1
How these 9 factors (in previous slide) justify any error coding
scheme? Provide proper Explanation for all factors.
(Hint: you can search the internet or can take help from books. )

Points to consider:
Date of submission is the next lecture.
Must be in printed form with text size of 12 and single line
spacing.
Use Times New Roman as font type.
Submit Assignment in proper file cover.
Design title page with Name & number of Assignment, names
of student & instructor and the date of submission.
Students not submitting within due date will be marked absent
for 2 lectures.
plagiarised assignments will be penalized severely (minimum 3
days absence from lectures will be marked).
7
Types of Error Control

Error detection and retransmission (Automatic Repeat Request,


ARQ)
Block codes
Forward Error Correction
Convolutional codes

CECOS University of IT & Emerging Sciences 8


Automatic Repeat Request
(ARQ)
When the error control consists of error detection only,
the communication system generally needs to provide
a means of alerting the transmitter that an error has
been detected and that a retransmission is necessary.
Such error control procedures are known as Automatic
Repeat Request or automatic Retransmission Query
(ARQ). Three most popular ARQ procedures are:
Stop-and-wait ARQ (requires half duplex channel)
Continuous ARQ with pullback (requires full duplex
channel)
Continuous ARQ with Selective repeat (requires full
duplex channel)
Stop-and-wait ARQ
Continuous ARQ with
pullback
Continuous ARQ with
Selective Repeat
Advantage
1. ARQ requires much simpler decoder and much less
redundancy (only error detection is needed) than does FEC.
2. ARQ can be considered as adaptive in the sense that data is
retransmitted only when errors occur.

Disadvantage
1. A feedback channel and retransmission strategy are
required.
2. Its variable transmission delay (large buffer stores or the
use of flow control technique is needed to cope with this).

* ARQ combined with FEC (hybrid ARQ) offers a powerful error


correction
capability.
CECOS University of IT & Emerging Sciences 13
Types of Error
Single bit Error
Only 1 bit of a given data unit(byte, character or
packet) changes from 1 to 0 or vice versa. e.g.
Transmitted byte 10110010
Received byte 10100010

Burst Error
2 or more bits in the data unit have changed.
Burst errors may or may not be happened in
consecutive bits.
CECOS University of IT & Emerging Sciences 14
Burst Errors
Transmitted bits 101100101
Received bits 110100110

Question
Burst errors are more likely to occur than a single
bit. Why ???

CECOS University of IT & Emerging Sciences 15


Answer for Nincompoops!!!

The main source of errors is noise which lasts for


more than a bit period.
The number of bits affected depends on data rate &
duration of noise. e.g.
A noise that lasts for 0.01sec can effect 100 bits if
data rate is 10Kbps.
Same noise affects 10,000 bits if data rate is 1Mbps.

CECOS University of IT & Emerging Sciences 16


Noise:
Noise could be a thermal noise or can be caused by
lightening
due to human errors
Equipment malfunctioning
Voltage surge
On top of that when you are walking in fading channel,
you will get burst errors.

To detect or/and correct errors, we use error control


coding also called CHANNEL CODING.

CECOS University of IT & Emerging Sciences 17


Block Diagram for Channel Coding

Information
Channel Coder Modulator
Source

C
H
Noise A
N
N
E
L

User Channel
De-Modulator
Information Decoder

CECOS University of IT & Emerging Sciences 18


Philosophy of Coding

The main philosophy of coding is to add more &


more structures in our codes.
Because what noise does is that it breaks structures.
If we have good structure in place (mostly algebraic
structure) then we are able to detect missing links &
hopefully correct them.

CECOS University of IT & Emerging Sciences 19


Basic Idea Behind Channel Coding

Add certain amount of systematic redundancy to the


message prior to its transmission through noisy channel.
The channel decoder in the receiver exploits the
redundancy to decide which message bits are actually
transmitted.
The combined objective of channel encoder & decoder is
to minimize the effect of channel noise.

CECOS University of IT & Emerging Sciences 20


Naturally present redundancy in
English
Examples:
CODNG THEORY IS N INTRSTNG SUBJCT

Any mistake in above sentence ???


CODING THEORY IS AN INTERESTNG SUBJECT

Any other example ?????


Hi. How R U ???
Wil u b thr ???

CECOS University of IT & Emerging Sciences 21


Channel Coding

In most cases channel encoder & modulator are


two separate blocks.
In some cases we combine the two to get coded
modulation e.g. Trellis Coded
Modulation

CECOS University of IT & Emerging Sciences 22


Few Definitions
A Word is a sequence of symbols also called dataword.
A Code is a set of vectors called codeword.
A Codeword is a sum of actual & redundant bits.

CECOS University of IT & Emerging Sciences 23


Arithmetic Operations
Hamming Distance
Hamming Distance
The hamming distance between two codewords c1 & c2 is the
number of places the codeword differs denoted by d(c1,c2).

e.g. C1=10110
C2=11011

d(c1,c2) = 3.
Hamming Weight
Hamming Weight
The Hamming weight of a codeword is equal to the number of
non-zero elements in the codeword c denoted by w(c).
e.g. C1=10110
C2=11011
Hamming weight = w(C1)=3
Hamming weight = w(C2)=4

It is easy to see that


d(c1 , c2) = w(c1+ c2)
C1=10110
C2=11011
C1+C2=01101 => w(c1,c2)= 3
Example 2:
w(10110) = 3
Weight of 10110
d(10110, 11011) = 3
Hamming distance of two codewords.

Table 10.1: A code for error detection


CECOS University of IT & Emerging Sciences 27
Single Parity Check Codes
Single Parity Check Codes
Single Parity Check Codes
Example 3
Example cont
The code is capable of detecting all single and
triple-error patterns. The probability of an
undetected error is equal to the probability that
two of four errors occurs any where in the
codeword.
4 2 4 4
Pnd p 1 p p
2

2 4
4! 4!
p 1 p
2
2
p4
2! 4 2 ! 4!( 4 4)!
6 p 2 (1 p ) 2 p 4
6 p 2 (1 p 2 2 p ) p 4
6 p 2 12 p 3 7 p 4
6 10 6
Why Use Error-Correction
Coding?
Comparison of typical coded verses uncoded error
performance

Figure: 6.9 Comparison of typical coded verses uncoded error performance


Trade-Off 1: Error
Performance verses
Bandwidth
Trade-Off 1: Error
Performance verses
Bandwidth
Trade-Off 2: Power verses
Bandwidth
Coding Gain
Trade-Off 3: Data Rate
verses Bandwidth
Block Codes
A block code is a code having all its words of same length.
We divide message into blocks of k bits called datawords.
Redundant bits r are added to make a block length n such
that n = k + r therefore n > k
The resultant block code is called (n , k) code.

CECOS University of IT & Emerging Sciences 41


With k bits, 2k datawords can be created, with
n bits 2n codewords can be created.
E.g. if k=2, Data words can be
00,01,10,11
And for n=3, valid codewords can be
000,001,010,011,100,101,110,111
Since n > k, 2n > 2k therefore (2n - 2k ) codewords
are not used. E.g, 23_ 22 = 8-4=4
The minimum distance of a code is the minimum hamming
distance between any two codewords.
If the code c consists of codewords
{Ci where i = 0,1,2....M-1} then the minimum distance of
the code is dmin = min[d(Ci , Cj)], i j
Code Rate
The term code rate defines the efficiency of a code.
The Code Rate of an (n,k) code is defined as the ratio(k/n) & reflects
the fraction of codeword that consists of information symbol.
Code rate must be less than or equal to 1.
Code rate equal to 1 means you are doing nothing for
(n = k) means no redundant bits.
CECOS University of IT & Emerging Sciences 43
Block Codes
encoder
k - bit message block n - bit codeword or vector

k data bits n k parity bits

n code bits
For an n , k code
nk
Redundancy 100%
k
k
Code rate
n
e.g. for (2, 1) code
1

Redundancy = 100% and code rate
2
It will require double the bandwidth of an uncoded signal. For (4, 3) code
3
Code rate Redundancy 33%
4
4
And the bandwidth expansion of only 44
3
Example 2:
Consider a Block code of 4 codewords
C = { 00000, 10100, 11110, 11001 }

Table 10.2: A code for error detection

CECOS University of IT & Emerging Sciences 45


Now for example to encode a bit stream 1001010011-----
What will be the first step ??
First step:
break sequence in group of two bits.
10 01 01 00 11
Next Step:
Replace each block by its corresponding codeword
You will get
11110 10100 10100 00000 11001---------

For short input stream it generates a long bit stream with


code rate k/n = 2/5. it also means 3 redundant bits.
In this example dmin = 2
CECOS University of IT & Emerging Sciences 46
Error Detection
How can errors be detected using block codes??
Only when two conditions are satisfied :
1. The receiver has a list of valid codewords
2. The original codeword is changed to an invalid one.
Refer to table 10.1
If sender encodes 01 as 011 & sends to receiver now
If receiver gets 011, means no error
If it gets 111, means not valid codeword. Error occurred.
If it gets 000, although error occurred but still valid
codeword. (error cant be detected)

CECOS University of IT & Emerging Sciences 47


Question arises that how many bits any
coding scheme can detect???
Condition for Error Detection

To detect t errors per block we have


dmin = t + 1
If t > dmin then errors may form another valid codeword which
may not be detected.
In other words it takes dmin errors to transform one codeword
to another.
The number of errors a code can detect are
t = dmin - 1

CECOS University of IT & Emerging Sciences 48


Error Correction
Error correction involves error detection first & then
correction.
It is much more complicated than error detection.
In error detection receiver needs to know only that
received codeword is invalid.
In error correction the receiver needs to find actual
codeword sent.
Thats why we need more redundant bits.

CECOS University of IT & Emerging Sciences 49


Example 3:
Let us add more redundant bits to table 10.1
Check if receiver can correct errors without knowing
what is actually sent.
Datawords Codewords
00 00000
01 01011
10 10101
11 11110

Table 10.3: A code for error correction.

CECOS University of IT & Emerging Sciences 50


Example 3: Cntd...
Now assume for dataword 01, sender sends 01011.
Its corrupted during transmission & received as 01001.
Receiver finds out that received codeword is not in table means
error occurs (error detected first).
If this code is considered to be single error correcting code
then receiver apply following strategy to guess actual data.
1. Comparing received codeword with first codeword in the
table. It differs in 2 bits therefore rejected.
2. For the same reason, original codeword cant be 3rd & 4th
one in table.
3. The only choice is the second one for it differs by only 1 bit.
4. The erroneous word will be replaced by that codeword .

CECOS University of IT & Emerging Sciences 51


What if more than 1 bit is
corrupted ???
Does our code still able to correct ???
If not then whats the solution ???
Solution
For that we first need to specify how many errors a code can
accurately detect & then correct.
There exists a condition for that:
Condition for Error Detection
To correct t errors per block we have
dmin = 2t + 1

CECOS University of IT & Emerging Sciences 52


Condition for Error Correction
Consider it diagrammatically.

c1 c2
t t

dmin > 2t+1

CECOS University of IT & Emerging Sciences 53


Condition for Error Correction Cntd....

Simply it means that it takes dmin distance to change one


codeword to another.
If two circles are touching then dmin >= 2t
Now if erroneous word is exactly t distance from both
the circles then decoder can not make a decision.
Therefore we have a safeguard of 2t + 1
The number of errors a code can correct are
t = (dmin 1)/2 (as dmin= 2t+1)

CECOS University of IT & Emerging Sciences 54


Sub Class of Block Codes
Linear Block Codes
(LBC)

CECOS University of IT & Emerging Sciences


Linear Block Codes (LBC)
Almost all block codes used today belong to Linear Block
Codes.
The structure of non-linear codes are difficult to
implement & analyze theoretically.
Still remember the philosophy of Coding???
To add more & more structure in our code.
Therefore the first constraint (structure) we put in our
block code is linearity that gives birth to LBC.

CECOS University of IT & Emerging Sciences 56


Properties of LBC
Linear codes must have following properties
1. Sum of two codewords belonging to a code is also a
codewords belonging to same code.
2. The all-zero codeword is also valid.
3. The minimum hamming distance between two codewords of
a linear code is equal to the minimum weights of any non-
zero codeword, i.e. dmin = wmin
4. The minimum weight of the code is the smallest weight of
any non-zero codeword & is denoted by wmin
5. The presence of an all-zero codeword is necessary but not
sufficient condition for linearity.

CECOS University of IT & Emerging Sciences 57


Properties of LBC Cntd....

So if we are asked to check weather a block


code is linear or not, we need to check all-zero
codeword is present or not.
If it is present then we check other conditions
otherwise it is straight a way non-linear block
code.

CECOS University of IT & Emerging Sciences 58


Types of Linear Block Codes

1. Repetition Code
2. Simple Parity-Check Code
3. Two dimensional Parity-Check Code
4. Hamming Codes

CECOS University of IT & Emerging Sciences 59


Simple Block
codes
1. Repetition code
Code words Rate Hamming distance Error correction c
000 1/3 3 1
111

00000 1/5 5 2
11111
. . . .
. . . .
. . . .
0 0 00 1/n n 1/2 (n-1)
1 1 11

2. Even-Parity code
Message Parity
Code word
000 0 0 0 0 0
100 1 1 1 0 0
010 1 1 0 1 0
110 0 0 1 1 0
001 1 1 0 0 1
101 0 0 1 0 1
011 0 0 0 1 1
111 1 1 1 1 1
Two dimensional Parity-Check Code

1 1 0 0 1 1 1 1 1 1 0 0 1 1 1 1

Row Parities
1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
0 1 1 1 0 0 1 0 0 1 1 1 0 0 1 0
0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1


Column Parities

Design of row & column One error affects two


parities parities

CECOS University of IT & Emerging Sciences 61


Two dimensional Parity-Check Code

1 1 0 0 1 1 1 1 1 1 0 0 1 1 1 1
1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
0 1 1 1 0 0 1 0 0 1 1 1 0 0 1 0
0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Two errors affects two Three errors affects Four


parities parities

CECOS University of IT & Emerging Sciences 62


Two dimensional Parity-Check Code

1 1 0 0 1 1 1 1
1 0 1 1 1 0 1 1
0 1 1 1 0 0 1 0
0 1 0 1 0 0 1 1
0 1 0 1 0 1 0 1

Four errors can not be


detected

CECOS University of IT & Emerging Sciences 63


Linear Block code Example
A (6,3) Linear Block Code Example
Vector Space
Vector Space: The set of all binary
n-tuples, Vn is called a vector space
over the binary field of two elements
(0 and 1).
Subspace: Within this vector space
there exists a subset of 2 k n-tuples
making up a subspace. They represent
the allowable codeword assignments.
Linear Block-code Structure
Generator Matrix
Generator Matrix cont
Generator Matrix cont
Generator Matrix cont

You might also like