Chapter 5: Linear Block Codes: Vahid Meghdadi
Chapter 5: Linear Block Codes: Vahid Meghdadi
Basic principles
Linear Block Coding
Vahid Meghdadi
University of Limoges
meghdadi@ensil.unilim.fr
Basic principles
Introduction
Block codes
Error detection
Error correction
Introduction
Definition:
The rate of a code is defined as k/n. For example for the previous
code n = 3, k = 2 so the rate is 2/3.
Linear codes
Definition:
A binary code is linear if the following condition is satisfied:
∀c1 ∈ C , ∀c2 ∈ C ⇒ c1 + c2 ∈ C
Definition :
Hamming weight of a binary sequence is defined as the number of
1 in the sequence.
w ([101]) = 2 w ([11101]) = 4
Definition:
Hamming distance between two binary sequences v and w is the
number of places where they differ.
Example
v = [110101]
⇒ d(v, w) = 2
w = [110011]
Good codes
A good code is one whose minimum distance is large.
For the previous example dmin = 2:
Code example
Pu (E ) = prob(e ∈ C)
Example
Pu (E ) = 7p 3 (1 − p)4 + 7p 4 (1 − p)3 + p 7
0 1-p
0
p
p
1 1
1-p
Number
of vectors (n-tuples) around a codeword with a distance of
n
u is: .
u
Definition: Hamming Sphere of radius r is the number of vectors
around a codeword with a Hamming distance up to t:
t
X n
V (n, t) =
j
j=0
Conclusion
I A block code with minimum distance dmin guarantees
correcting all error patterns of t = b(dmin − 1)/2c or fewer.
I t = b(dmin − 1)/2c is called error correcting capability of the
code.
I Some patterns of t + 1 or more can be corrected as well.
I In general, for a t-error-correcting (n, k) linear code, 2n−k
error patterns can be corrected.
I For a t-error-correcting (n, k) linear code and using an optimal
error correcting algorithm at the receiver, the probability that
the receiver make a bad correction is upper bounded by
n
X n
P(E ) < p i (1 − p)n−i
i
i=t+1
Basic principles
Introduction
Block codes
Error detection
Error correction
Introduction
Code subspace
c = m0 g0 + m1 g1 + · · · + mk−1 gk−1
Generator matrix
c = mG
Equivalent code
I One can obtain the same code (same codewords) but with a
different generator matrix. For example, we can exchange any
two rows of G.
I The only difference is that we obtain another mapping from
information sequences to codewords.
I We can replace each row by a linear combination of that row
with another row.
I All the codes obtained are equivalent.
Systematic codes
Definition:
I If in all the codewords we can find exactly the corresponding
information sequence, the code is called systematic.
It is convenient to group all these bits either at the end or at the
beginning of the code word.
I In this case the generator matrix can be divided into two sub
matrices [P|I ].
Systematic codes
g0 p00 p01 ··· p0,n−1 1 0 ···0
g1 p10 p11 ··· p1,n−1 0 1 ···0
G= =
.. .. .. .. .. .. .. .. ..
. . . . . . . . .
gk−1 pk−1,0 pk−1,1 · · · pk−1,n−1 0 0 ···1
G = [Pn×n−k Ik×k ]
So for a given message m the codeword will be
c = mG = [mP m]1×n . The first part of the codeword is the
parity bits and the second is the systematic part of the codeword.
Note:Any linear code can be transformed into systematic code.
Example
0 1 1 0 0 0 1
Singleton bound
dmin ≤ n − k + 1
rHT = 0
Syndrome Decoding
Exercise
Exercise
Hamming Code
Definition: If the syndrome table becomes complete for all
w (e) ≤ t the code is called perfect.
For example for the code (7, 4) with t = 1, the syndrome table is
completed for all the error patterns of weight 1. These codes with
t = 1 are called Hamming codes.
For Hamming codes, there are 2n−k − 1 non-zero syndromes. This
number must be equal to the number of error patterns of weight 1.
It means that 2n−k − 1 = n. Calling the number of parities
m = n − k, we can write for a Hamming code that:
k = 2m − m − 1
Pu curves
I R = 4/7 0
10
(15,11)
I Eb /N0 = 6dB, −2
10
(7,4)
p = 0.0165
I Eb /N0 = 10dB, −4
10
p = 3.6 × 10−4 −6
Pu
10
I R = 11/15
−8
I Eb /N0 = 6dB, 10
p = 0.0078 −10
10
I Eb /N0 = 10dB,
p = 6.41 × 10−5 −12
10
0 2 4 6 8 10
SNR(dB)
−2
10
−3
10
P(F)
−4
10
−5
10
−6
10
−7
10
0 1 2 3 4 5 6 7 8 9 10
Eb/N0(dB)
Note that this is not the bit error rate probability but word error
rate probability.
Vahid Meghdadi Chapter 5: Linear Block Codes
Outline
Basic principles
Linear Block Coding