KEMBAR78
Linear Block code.pdf
U18ECI6201T -
Communication
Engineering – II
Unit-3-Error Control
Coding
Linear Block Codes
Dr.K.Thilagavathi
Department of Electronics and
Communication Engineering
Overview of this Lecture
➢ Introduction
➢ Linear block codes
➢ Generator matrix
➢ Systematic encoding
➢ Parity check matrix
➢ Syndrome and error detection
➢ Minimum distance of block codes
➢ Applications
2
Introduction to Error Control
Coding
2 Key parameters for design:
Transmitted Signal Power
Bandwidth
-Eb /N0….decides Bit error rate
-For a fixed Eb /N0,data quality change is obtained via
error control coding.
-To reduce required Eb /N0 for a fixed bit error rate.
3
Introduction
4
Model of Digital Communication
System
5
 Channel coding:
• Transform signals to improve communications performance
by increasing the robustness against channel impairments
(noise, interference, fading, ..)
 Waveform coding: Transform waveforms to better
waveforms
 Structured sequences: Transform data sequences into better
sequences, having structured redundancy.
-“Better” in the sense of making the decision process less
subject to errors.
6
7
Error control techniques
 Automatic Repeat reQuest (ARQ)
 Full-duplex connection, error detection codes
 The receiver sends a feedback to the transmitter, saying that if
any error is detected in the received packet or not (Not-
Acknowledgement (NACK) and Acknowledgement (ACK),
respectively).
 The transmitter retransmits the previously sent packet if it
receives NACK.
 Forward Error Correction (FEC)
 Simplex connection, error correction codes
 The receiver tries to correct some errors
 Hybrid ARQ (ARQ+FEC)
 Full-duplex, error detection and correction codes
Channel models
• Discrete memory-less channels
• Discrete input, discrete output
• Binary Symmetric channels
• Binary input, binary output
• Gaussian channels
• Discrete input, continuous output
8
Linear block codes
• A code is said to be linear if any two code words in the
code can be added in modulo-2 arithmetic to produce
a third code word in the code.
• (n,k) representation
• n-o/p bits; k-msg bits[ 2^k msg combinations]
• n-k—parity bits
• Code word structure:
9
10
11
12
13
14
Some definitions
• Binary field :
• The set {0,1}, under modulo 2 binary addition
and multiplication forms a field.
• Binary field is also called Galois field, GF(2).
0
1
1
1
0
1
1
1
0
0
0
0
=

=

=

=

1
1
1
0
0
1
0
1
0
0
0
0
=

=

=

=

Addition Multiplication
15
• The information bit stream is chopped into blocks of
k bits.
• Each block is encoded to a larger block of n bits.
• The coded bits are modulated and sent over
channel.
• The reverse procedure is done at the receiver.
Data block
Channel
encoder
Codeword
k bits n bits
rate
Code
bits
Redundant
n
k
R
n-k
c=
16
• Code word: Encoded block of n bits.
• Block length: n
• Code rate / code efficiency: Ratio of msg bits to encoder
o/p.
r=k/n ; 0<r<1
• Channel data rate: bit rate at the o/p of encoder.
• Code vectors
Linear block codes-Terminologies
17
• The Hamming weight of vector U, denoted by w(U), is
the number of non-zero elements in U.
The hamming weight of c=(11000110) is 4
• The Hamming distance between two vectors U and V, is
the number of elements in which they differ.
The hamming distance between c=(11000110) and x=(00100100) is 4
• The minimum distance of a block code is
It is defined as the smallest distance between any pair of code vectors
in the code.
)
(
)
( V
U
V
U, 
=
w
d
)
(
min
)
,
(
min
min i
i
j
i
j
i
w
d
d U
U
U=
=

Linear block codes-Terminologies
18
• Error detection capability is given by
• Error correcting-capability t of a code, which is
defined as the maximum number of guaranteed
correctable errors per codeword, is





 −
=
2
1
min
d
t
1
min−
=d
e
19
Linear block codes – cont’d
• Systematic block code (n,k)
• For a systematic code, the first (or last) k elements
in the codeword are information bits.
matrix
)
(
matrix
identity
]
[
k
n
k
k
k
k
k
k
−

=

=
=
P
I
I
P
G
)
,...,
,
,
,...,
,
(
)
,...,
,
(
bits
message
2
1
bits
parity
2
1
2
1













 k
k
n
n m
m
m
p
p
p
u
u
u −
=
=
U
20
Linear block codes – cont’d
• Systematic block code (n,k)
• For a systematic code, the first (or last) k elements
in the codeword are information bits.
matrix
)
(
matrix
identity
]
[
k
n
k
k
k
k
k
k
−

=

=
=
P
I
I
P
G
)
,...,
,
,
,...,
,
(
)
,...,
,
(
bits
message
2
1
bits
parity
2
1
2
1













 k
k
n
n m
m
m
p
p
p
u
u
u −
=
=
U
21
22
Linear block codes – cont’d
• Example: Block code (6,3)










=










=
1
0
0
0
1
0
0
0
1
1
1
0
0
1
1
1
0
1
3
2
1
V
V
V
G
1
1
1
1
1
0
0
0
0
1
0
1
1
1
1
1
1
0
1
1
0
0
0
1
1
0
1
1
1
1
1
0
0
0
1
1
1
1
0
0
0
1
1
0
1
0
0
0
1
0
0
0
1
0
1
0
0
1
1
0
0
1
0
0
0
0
1
0
0
0
1
0
Message vector Codeword
23
Linear block codes – cont’d
• For any linear code we can find an matrix
such that its rows are orthogonal to the
rows of :
• H is called the parity check matrix and
its rows are linearly independent.
• For systematic linear block codes:
n
k
n 
− )
(
H
G
0
GH =
T
]
[ T
k
n P
I
H −
=
24
25
Linear block codes – cont’d
• Syndrome testing:
• S is syndrome of r, corresponding to the error
pattern e.
Format
Channel
encoding
Modulation
Channel
decoding
Format
Demodulation
Detection
Data source
Data sink
U
r
m
m̂
channel
or vector
pattern
error
)
,....,
,
(
or vecto
codeword
received
)
,....,
,
(
2
1
2
1
n
n
e
e
e
r
r
r
=
=
e
r
e
U
r +
=
T
T
eH
rH
S =
=
26
SYNDROME DECODING
 The generator matrix G is used in the encoding operation at
the transmitter
 The parity- check matrix H is used in the decoding
operation at the receiver
 Let y denote 1-by-n received vector that results from
sending the code x over a noisy channel
• y=x +e
27
28
29
PROPERTIES
• Property 1:
 The syndrome depends only on the error
•pattern and not on the transmitted code
word.
 S=(x+e)HT
• =xHT + eHT =e HT
30
PROPERTY 2:
 All error pattern that differs at most by a code word
have the same syndrome.
 For k message bits ,there are 2^k distinct codes
denoted as xi ,i=0,1, ………. 2^k -1
• For any error pattern e, we define 2^k distinct error
vectors as
• ei =e+ xi i=0,1,… 2^k-1
• ei HT = e HT + xi HT
• S= ei HT = e HT
31
PROPERTY 3:
• The syndrome s is the sum of those columns of
matrix H corresponding to the error locations
H=[ …… ]therefore,
s=
32
PROPERTY 4:
•With syndrome decoding ,an (n,k) linear block
code can correct up to t errors per code word
provided that n and k satisfy the hamming bound
≥
n—Binomial Coefficient= n! / (n-i)! i!
i
33
34
Linear block codes – cont’d
• Standard array
• For row , find a vector in of
minimum weight which is not already listed in the
array.
• Call this pattern and form the row as the
corresponding coset
k
k
n
k
n
k
n
k
k
2
2
2
2
2
2
2
2
2
2
2
2
1
U
e
U
e
e
U
e
U
e
e
U
U
U




−
−
− 






zero
codeword
coset
coset leaders
k
n
i −
= 2
,...,
3
,
2 n
V
i
e th
:
i
Linear block codes – cont’d
• Standard array and syndrome table
decoding
1. Calculate
2. Find the coset leader, , corresponding to
3. Calculate and corresponding .
• Note that
• If , error is corrected.
• If , undetectable decoding error occurs.
T
rH
S =
i
e
e =
ˆ S
e
r
U ˆ
ˆ +
= m̂
)
ˆ
ˆ
(
ˆ
ˆ e
(e
U
e
e)
U
e
r
U +
+
=
+
+
=
+
=
e
e =
ˆ
e
e 
ˆ
35
Linear block codes – cont’d
• Example: Standard array for the (6,3) code
010110
100101
010001
010100
100000
100100
010000
111100
001000
000110
110111
011010
101101
101010
011100
110011
000100
000101
110001
011111
101011
101100
011000
110111
000010
000110
110010
011100
101000
101111
011011
110101
000001
000111
110011
011101
101001
101110
011010
110100
000000






Coset leaders
coset
codewords
36
Linear block codes – cont’d
111
010001
100
100000
010
010000
001
001000
110
000100
011
000010
101
000001
000
000000
(101110)
(100000)
(001110)
ˆ
ˆ
estimated
is
vector
corrected
The
(100000)
ˆ
is
syndrome
this
to
ing
correspond
pattern
Error
(100)
(001110)
:
computed
is
of
syndrome
The
received.
is
(001110)
ted.
transmit
(101110)
=
+
=
+
=
=
=
=
=
=
=
e
r
U
e
H
rH
S
r
r
U
T
T
Error pattern Syndrome
37
• Hamming codes
• Hamming codes are a subclass of linear block
codes and belong to the category of perfect
codes.
• Hamming codes are expressed as a function of
a single integer m≥3.
Hamming codes
t
m
n-k
m
k
n
m
m
1
:
capability
correction
Error
:
bits
parity
of
Number
1
2
:
bits
n
informatio
of
Number
1
2
:
length
Code
=
=
−
−
=
−
=
38
Hamming codes
• Example: Systematic Hamming code
(7,4)
]
[
1
0
1
1
1
0
0
1
1
0
1
0
1
0
1
1
1
0
0
0
1
3
3
T
P
I
H 
=










=
]
[
1
0
0
0
1
1
1
0
1
0
0
0
1
1
0
0
1
0
1
0
1
0
0
0
1
1
1
0
4
4

=












= I
P
G
39
Applications
40
Summary
• Linear Block Codes
• Encoding and Decoding
• Hamming Codes
41
42
43
44
45
46
Linear Block code.pdf

Linear Block code.pdf

  • 1.
    U18ECI6201T - Communication Engineering –II Unit-3-Error Control Coding Linear Block Codes Dr.K.Thilagavathi Department of Electronics and Communication Engineering
  • 2.
    Overview of thisLecture ➢ Introduction ➢ Linear block codes ➢ Generator matrix ➢ Systematic encoding ➢ Parity check matrix ➢ Syndrome and error detection ➢ Minimum distance of block codes ➢ Applications 2
  • 3.
    Introduction to ErrorControl Coding 2 Key parameters for design: Transmitted Signal Power Bandwidth -Eb /N0….decides Bit error rate -For a fixed Eb /N0,data quality change is obtained via error control coding. -To reduce required Eb /N0 for a fixed bit error rate. 3
  • 4.
  • 5.
    Model of DigitalCommunication System 5
  • 6.
     Channel coding: •Transform signals to improve communications performance by increasing the robustness against channel impairments (noise, interference, fading, ..)  Waveform coding: Transform waveforms to better waveforms  Structured sequences: Transform data sequences into better sequences, having structured redundancy. -“Better” in the sense of making the decision process less subject to errors. 6
  • 7.
    7 Error control techniques Automatic Repeat reQuest (ARQ)  Full-duplex connection, error detection codes  The receiver sends a feedback to the transmitter, saying that if any error is detected in the received packet or not (Not- Acknowledgement (NACK) and Acknowledgement (ACK), respectively).  The transmitter retransmits the previously sent packet if it receives NACK.  Forward Error Correction (FEC)  Simplex connection, error correction codes  The receiver tries to correct some errors  Hybrid ARQ (ARQ+FEC)  Full-duplex, error detection and correction codes
  • 8.
    Channel models • Discretememory-less channels • Discrete input, discrete output • Binary Symmetric channels • Binary input, binary output • Gaussian channels • Discrete input, continuous output 8
  • 9.
    Linear block codes •A code is said to be linear if any two code words in the code can be added in modulo-2 arithmetic to produce a third code word in the code. • (n,k) representation • n-o/p bits; k-msg bits[ 2^k msg combinations] • n-k—parity bits • Code word structure: 9
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
    Some definitions • Binaryfield : • The set {0,1}, under modulo 2 binary addition and multiplication forms a field. • Binary field is also called Galois field, GF(2). 0 1 1 1 0 1 1 1 0 0 0 0 =  =  =  =  1 1 1 0 0 1 0 1 0 0 0 0 =  =  =  =  Addition Multiplication 15
  • 16.
    • The informationbit stream is chopped into blocks of k bits. • Each block is encoded to a larger block of n bits. • The coded bits are modulated and sent over channel. • The reverse procedure is done at the receiver. Data block Channel encoder Codeword k bits n bits rate Code bits Redundant n k R n-k c= 16
  • 17.
    • Code word:Encoded block of n bits. • Block length: n • Code rate / code efficiency: Ratio of msg bits to encoder o/p. r=k/n ; 0<r<1 • Channel data rate: bit rate at the o/p of encoder. • Code vectors Linear block codes-Terminologies 17
  • 18.
    • The Hammingweight of vector U, denoted by w(U), is the number of non-zero elements in U. The hamming weight of c=(11000110) is 4 • The Hamming distance between two vectors U and V, is the number of elements in which they differ. The hamming distance between c=(11000110) and x=(00100100) is 4 • The minimum distance of a block code is It is defined as the smallest distance between any pair of code vectors in the code. ) ( ) ( V U V U,  = w d ) ( min ) , ( min min i i j i j i w d d U U U= =  Linear block codes-Terminologies 18
  • 19.
    • Error detectioncapability is given by • Error correcting-capability t of a code, which is defined as the maximum number of guaranteed correctable errors per codeword, is       − = 2 1 min d t 1 min− =d e 19
  • 20.
    Linear block codes– cont’d • Systematic block code (n,k) • For a systematic code, the first (or last) k elements in the codeword are information bits. matrix ) ( matrix identity ] [ k n k k k k k k −  =  = = P I I P G ) ,..., , , ,..., , ( ) ,..., , ( bits message 2 1 bits parity 2 1 2 1               k k n n m m m p p p u u u − = = U 20
  • 21.
    Linear block codes– cont’d • Systematic block code (n,k) • For a systematic code, the first (or last) k elements in the codeword are information bits. matrix ) ( matrix identity ] [ k n k k k k k k −  =  = = P I I P G ) ,..., , , ,..., , ( ) ,..., , ( bits message 2 1 bits parity 2 1 2 1               k k n n m m m p p p u u u − = = U 21
  • 22.
  • 23.
    Linear block codes– cont’d • Example: Block code (6,3)           =           = 1 0 0 0 1 0 0 0 1 1 1 0 0 1 1 1 0 1 3 2 1 V V V G 1 1 1 1 1 0 0 0 0 1 0 1 1 1 1 1 1 0 1 1 0 0 0 1 1 0 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 1 0 0 1 0 0 0 0 1 0 0 0 1 0 Message vector Codeword 23
  • 24.
    Linear block codes– cont’d • For any linear code we can find an matrix such that its rows are orthogonal to the rows of : • H is called the parity check matrix and its rows are linearly independent. • For systematic linear block codes: n k n  − ) ( H G 0 GH = T ] [ T k n P I H − = 24
  • 25.
  • 26.
    Linear block codes– cont’d • Syndrome testing: • S is syndrome of r, corresponding to the error pattern e. Format Channel encoding Modulation Channel decoding Format Demodulation Detection Data source Data sink U r m m̂ channel or vector pattern error ) ,...., , ( or vecto codeword received ) ,...., , ( 2 1 2 1 n n e e e r r r = = e r e U r + = T T eH rH S = = 26
  • 27.
    SYNDROME DECODING  Thegenerator matrix G is used in the encoding operation at the transmitter  The parity- check matrix H is used in the decoding operation at the receiver  Let y denote 1-by-n received vector that results from sending the code x over a noisy channel • y=x +e 27
  • 28.
  • 29.
  • 30.
    PROPERTIES • Property 1: The syndrome depends only on the error •pattern and not on the transmitted code word.  S=(x+e)HT • =xHT + eHT =e HT 30
  • 31.
    PROPERTY 2:  Allerror pattern that differs at most by a code word have the same syndrome.  For k message bits ,there are 2^k distinct codes denoted as xi ,i=0,1, ………. 2^k -1 • For any error pattern e, we define 2^k distinct error vectors as • ei =e+ xi i=0,1,… 2^k-1 • ei HT = e HT + xi HT • S= ei HT = e HT 31
  • 32.
    PROPERTY 3: • Thesyndrome s is the sum of those columns of matrix H corresponding to the error locations H=[ …… ]therefore, s= 32
  • 33.
    PROPERTY 4: •With syndromedecoding ,an (n,k) linear block code can correct up to t errors per code word provided that n and k satisfy the hamming bound ≥ n—Binomial Coefficient= n! / (n-i)! i! i 33
  • 34.
    34 Linear block codes– cont’d • Standard array • For row , find a vector in of minimum weight which is not already listed in the array. • Call this pattern and form the row as the corresponding coset k k n k n k n k k 2 2 2 2 2 2 2 2 2 2 2 2 1 U e U e e U e U e e U U U     − − −        zero codeword coset coset leaders k n i − = 2 ,..., 3 , 2 n V i e th : i
  • 35.
    Linear block codes– cont’d • Standard array and syndrome table decoding 1. Calculate 2. Find the coset leader, , corresponding to 3. Calculate and corresponding . • Note that • If , error is corrected. • If , undetectable decoding error occurs. T rH S = i e e = ˆ S e r U ˆ ˆ + = m̂ ) ˆ ˆ ( ˆ ˆ e (e U e e) U e r U + + = + + = + = e e = ˆ e e  ˆ 35
  • 36.
    Linear block codes– cont’d • Example: Standard array for the (6,3) code 010110 100101 010001 010100 100000 100100 010000 111100 001000 000110 110111 011010 101101 101010 011100 110011 000100 000101 110001 011111 101011 101100 011000 110111 000010 000110 110010 011100 101000 101111 011011 110101 000001 000111 110011 011101 101001 101110 011010 110100 000000       Coset leaders coset codewords 36
  • 37.
    Linear block codes– cont’d 111 010001 100 100000 010 010000 001 001000 110 000100 011 000010 101 000001 000 000000 (101110) (100000) (001110) ˆ ˆ estimated is vector corrected The (100000) ˆ is syndrome this to ing correspond pattern Error (100) (001110) : computed is of syndrome The received. is (001110) ted. transmit (101110) = + = + = = = = = = = e r U e H rH S r r U T T Error pattern Syndrome 37
  • 38.
    • Hamming codes •Hamming codes are a subclass of linear block codes and belong to the category of perfect codes. • Hamming codes are expressed as a function of a single integer m≥3. Hamming codes t m n-k m k n m m 1 : capability correction Error : bits parity of Number 1 2 : bits n informatio of Number 1 2 : length Code = = − − = − = 38
  • 39.
    Hamming codes • Example:Systematic Hamming code (7,4) ] [ 1 0 1 1 1 0 0 1 1 0 1 0 1 0 1 1 1 0 0 0 1 3 3 T P I H  =           = ] [ 1 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 0 0 1 1 1 0 4 4  =             = I P G 39
  • 40.
  • 41.
    Summary • Linear BlockCodes • Encoding and Decoding • Hamming Codes 41
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.