You are on page 1of 36

Chapter 3

Channel Coding
Dr. Mohamed A. Abdelhamed
Department of Communication and Computer Eng.
Higher Institute of Engineering, El-Shorouk Academy.
Academic year (2018-2019)

Contacts:
WhatsApp: +201002323525
E-mail: m.abdelhamed@sha.edu.eg
mohabdelhamed@yahoo.com
3.1 Introduction

2
3.1 Introduction…
 Channel coding can be classified into two types,
(1) Waveform (or signal design) coding.
(2) Structed sequences (or structed redundancy).

 Waveform coding: deals with transforming waveforms


into "better waveforms," in order to make the detection
process less subject to errors.
 Structed sequences: having structed redundancy
(redundant bits). The redundant bits can be used for the
detection and correction of errors.

3
3.1 Introduction…
Hence, possibility of correct the code using channel
coding by redundant bits.
; as redundant bits increase, the performance increase
but at expense of B.W.

4
3.2 Types of error control
 There are two basic methods for controlling the
errors using the structured redundancy,
(1)Automatic repeat request or automatic
retransmission query (ARQ)
(2)Forward error correction (FEC).

 ARQ: used in data communication (error detection


only). ; the communication system provides a means
of alerting the transmitter that an error has been
detected and that a retransmission is necessary.
 FEC: used in real time communication (error
detection and correction without retransmission). 5
3.2 Types of error control…
 The most popular ARQ procedures are stop-and-
wait, continuous ARQ with pullback, and continuous
ARQ with selective repeat, as shown in Figure 3.1.
 In stop-and-wait procedure, the transmitter waits
for an acknowledgement (ACK) of each transmission
before it proceeds with the next transmission.
In Figure 3.1a, the third transmission block is
received in error and, therefore, the receiver
responds with negative acknowledgement (NAK).
Then, the transmitter retransmits this third message
block before transmitting the next message (fourth).
This procedure requires a half-duplex connection
only. 6
3.2 Types of error control…

Figure 3.1: Automatic repeat request (ARQ) procedures. (a)Stop-and-wait


(b)continuous ARQ with pullback (c) continuous ARQ with selective repeat. 7
3.2 Types of error control…
 In continuous ARQ with pullback, a full-duplex
connection is necessary since both terminals are
transmitting simultaneously. The transmitter is sending
message data and the receiver is sending
acknowledgement data. Each block of data should be
assigned a sequence number and the ACKs and NAKs
should reference to these numbers. When the
transmitter receives a NAK corresponds to specific
corrupted message, the transmitter pulls back to the
message in error and retransmits all message data,
starting with the corrupted message.

8
3.2 Types of error control…
 In continuous ARQ with selective repeat, a full-
duplex connection is needed. In this procedure, only
the corrupted message is repeated.

 The major advantage of ARQ over FEC is that


error detection requires much simpler decoding
equipment and much less redundancy, i.e. higher
throughput, than does error correction. Moreover, ARQ
is adaptive in the sense that information is
retransmitted only when errors occur.

9
3.2 Types of error control…
 However, FEC is desirable for any of the following
reasons:

1. A reverse channel is not available or the delay with


ARQ would be excessive.

2. The expected number of errors, without correction,


would require excessive retransmission.

10
3.3 Parity Check Codes
 Parity check code (error detection only): add parity
symbols or parity bits that are determined using the
linear sums of the information bits.

 In single parity check code, a single parity bit is added


to a block of data bits. The parity bit has the value of 0 or
1 such that the summation of all 1’s in the code word is
even (in even parity code) or odd (in odd parity code).

 At the receiving terminal, the decoding procedure


consists of testing that the modulo-2 sum of the code
word bits is zero (in even parity code) or 1 (in odd parity
code). 11
3.3 Parity Check Codes…
 If the result is found to be different, the code word is
known to contain errors. In this case, the decoder can
detect the presence of an odd number of bit errors but it
cannot detect an even number of bit errors since the
parity test will appear correct.

 Thus, the probability of undetected error is


l
n  2j
Pnd     p (1  p)n  2 j
j 1 2 j 

12
3.3 Parity Check Codes…

n j
P( j , n)    p (1  p)n  j
 j

13
3.3 Parity Check Codes…
where
n n!
 j 
  j !(n  j )!

 Generally, the code rate in single parity codes,


k k
r 
n k 1

14
3.3 Parity Check Codes…

15
3.3 Parity Check Codes…
Solution:
Message Parity Codeword

000 0 0 000

100 1 1 100

010 1 1 010

110 0 0 110

001 1 1 001

101 0 0 101

011 0 0 011

111 1 1 111

16
3.3 Parity Check Codes…
The code can detect single and triple error patterns.
The probability of an undetected error is equal to the
probability that two or four errors occur any where in
a code word, that is
2
n  2j
Pnd     p (1  p)n  2 j
j 1 2 j 

 4 2 2  4 4
   p (1  p)    p
 2  4

 6 p 2  12 p3  7 p 4 6  106
17
Error Detection and Correction Techniques
 Error detection and correction techniques can be
classified as:
(1) Linear Codes:
(1.1) Block Codes
(1.2) Cyclic Codes
(1.3) Turbo Codes
(2) Convolutional Codes.

18
3.4 Linear Block Codes
 A linear block code is a family of parity check codes in
which a data word (or data vector) of successive 𝑘 bits
is assigned a code word (or code vector) of 𝑛 bits
where 𝑛 > 𝑘.
 Linear block codes are forward error correction
technique.
 This code is characterized by the notation (𝑛, 𝑘) code.
 The number of added (or redundant) bits is 𝑚 = 𝑛 − 𝑘
which are determined from the message (data) bits
according to a prescribed encoding rule.
 These 𝑚 bits are known as parity check bits or shortly
parity bits. 19
3.4 Linear Block Codes …
 This code has a code efficiency or code rate
𝑘
𝑟=
𝑛
 The coded data rate is

𝑅 𝑛. 𝑅
𝑅𝑐 = =
𝑟 𝑘
where 𝑅 = 𝑅𝑏 is the data rate before coding.

20
3.4 Linear Block Codes …
 The data words and the code words can be expressed as
vectors, that is
𝐷 = (𝑑1 , 𝑑2 , … , 𝑑𝑘 )

𝐶 = (𝑐1 , 𝑐2 , … , 𝑐𝑘 )
 Number of data words (k-tuple data vector)=2𝑘 .
 Number of code words (n-tuple code vectors)=2𝑛 .
 The subset of 2𝑘 code vectors represents a subspace
selected from the entire vector space that has 2𝑛 n-tuple
code vectors.

21
3.4 Linear Block Codes …

Figure 3.1 The structure of linear block code. 22


3.4 Linear Block Codes …
 Figure 3.1 shows the structure of a linear block code.
The allowable (or valid) code vectors are 2𝑘 𝑛-tuple
vectors that are shown sprinkled among the entire
vector space that has 2𝑛 𝑛-tuple vectors or points.

 A message or data word is encoded into one of the 2𝑘


𝑛-tuple code vectors.

 Because of the channel noise, the received vector is a


perturbed version of the transmitted code vector where
the decoder can decode the corrupted (erroneous)
message correctly.
23
3.4 Linear Block Codes …
 For Example:
Consider (7, 4) code
- The number of data vector=24 = 16 different data
vectors.
- The number of coded vector=27 = 128 different code
vector.

• Then we take the better 16 different code word from


128 at expense of “larger code distance” (which is
difficult that, a code goes to another code where if a
code goes to another code then it is undetectable code).
• The ability of block code to correct the error is a
function of the code distance. 24
3.4 Linear Block Codes …
 Example:

𝐶1 =1 0 1 1 0 0 1 valid code vector

𝐶2 =1 0 0 1 0 1 1 valid code vector

• Then the distance between two vectors = 2.


 We want that, the code distance between code vector is
large as possible. Then the valid code vector is difficult
to goes to another valid code vector (if the codes goes
to another code, it does not detect (un detectable)).
25
3.4 Linear Block Codes …
 Example:

𝐶1 =1 1 1 1 1 1 1 𝐶1 =1 1 1 1 1 1 1
+

𝐶2 =0 0 1 0 1 0 1 𝐶2 =0 0 1 0 1 0 1

Code distance [d]=4 Weight [W]=1101010

 We can show that, the weight of two added vectors


(Number of ones) = distance
; 𝑑 = 𝐶1 , 𝐶2 = 𝑊(𝐶1 + 𝐶2 )

26
3.4 Linear Block Codes …
Encoding
 Encoding of linear block codes can be classified as
(1) Systematic Code
(2) Non Systematic Code

 In systematic code: the first 𝑘 bits of the code are the


data bits while the last 𝑚 = 𝑛 − 𝑘 bits are the parity
bits, that is
𝐶𝑖 = 𝑑𝑖 for 𝑖 ≤ 𝑘

𝐶𝑖 = 𝑝𝑖−𝑘 for 𝑘 < 𝑖 ≤ 𝑛

27
3.4 Linear Block Codes …
Encoding …
 Thus, the code vector can be represented as

𝑪 = (𝒅𝟏 , 𝒅𝟐 , … , 𝒅𝒌 , 𝒑𝟏 , 𝒑𝟐 , … , 𝒑𝒎 )

message bits parity bits

i.e.; the data vector goes to code vector but concatenated

28
3.4 Linear Block Codes …
Encoding …
 In non systematic code: the code word 𝐶 for a data
word 𝐷 can be generated as 𝐶 = 𝐷𝐺 w (data is mixed
with the added bits) where 𝐺 is a generator matrix
given by

𝐺 = [𝐼𝑘∗𝑘 𝑃𝑘∗𝑚 ]

Concatenated
 The code vector, C,
𝑪 = 𝑪𝟏 , 𝑪𝟐 , … , 𝑪𝒌 , 𝑪𝒌+𝟏 , 𝑪𝒌+𝟐 , … , 𝑪𝒌+𝒎 , 𝑪𝒌+𝒎 = 𝑪𝒏
= 𝒅𝟏 , 𝒅𝟐 , … , 𝒅𝒌 , 𝑷𝟏 , 𝑷𝟐 , … , 𝑷𝒎 ;systematic code

data bits parity (redundant) bits 29


3.4 Linear Block Codes …
Encoding …

𝐶1∗𝑛 = 𝐷1∗𝑘 . 𝐺𝑘∗𝑛


where
𝐶: Code vector
𝐷: Data vector
𝐺: Generator matrix = 𝐼 𝑃

30
3.4 Linear Block Codes …
Encoding …

1 0 ...0 p11 p12 ... p1m 


0 1 ...0 p p ... p 
G  21 22 2m 
  I k k : Pk m k n
..... 
 
0 0... 1 pk1 pk 2 ... pkm 

I k k Pk m

31
3.4 Linear Block Codes …
Encoding …

1 0 ...0 p11 p12 ... p1m 


0 1 ...0 p p ... p 
C  DG  1 2
( d , d , ..., d )  21 22 2m 
k
..... 
 
0 0... 1 pk1 pk 2 ... pkm 

 (c1, c2 , ..., ck , ck 1, ck  2 , ..., cn )

where, 𝑐𝑘+1 = 𝑑1 𝑃11 + 𝑑2 𝑃21 + … + 𝑑𝑘 𝑃𝑘+1


32
3.4 Linear Block Codes …
Encoding …
 The encoder of linear block code:

Figure 3.2 Encoder for linear block code


33
3.4 Linear Block Codes …
Encoding …
 The systematic encoder, shown in Fig. 3.2 uses k-
stage shift register to which a k-tuple data word is
applied at a time.

 When the data word is stored in the register, the parity


check bits 𝑝1 , 𝑝2 , … , 𝑝𝑚 is obtained using the
combinational logic circuit.

 Then, the commutator is used to select (or multiplex)


the data bits first which are followed by the parity
check bits providing the code word in the systematic
form.
34
3.4 Linear Block Codes …
Decoding
 The

35
?

36

You might also like