Unit 2
Unit 2
• M = 4, k = 2 and n = 5
• The sequence to be encoded is 1 0 0 1 0 1 0
0 1 1.…
• Partitioned: 10 01 01 00 11…
• Codeword: 11110 10100 10100 00000
11001…
Code Rate
Minimum Distance
Minimum Weight
Properties
Parity-check codes
d* = 2.
Algebra - Field
Group, Ring & Field
Galois Fields – Finite Field
Properties
GF(2)
GF(7)
GF(4)
GF(6) Ring
Error control techniques
Channel
Data block Codeword
encoder
k bits n bits
e d min 1
• For memory less channels, the probability that the decoder commits an
erroneous decoding is
n
n j
PM p (1 p) n j
j t 1 j
1 n
n j
PB
n
j
j t 1 j
p (1 p ) n j
Linear block codes – cont’d
U mG V1
V
(u1 , u 2 , , u n ) (m1 , m2 , , mk ) 2
Vk
(u1 , u 2 , , u n ) m1 V1 m2 V2 m2 Vk
– The rows of G, are linearly independent.
– The sum of any two codewords is also a codeword.
Codeword
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.
G [P I k ] Coefficient
Matrix gives
I k k k identity matrix dependency of
parity bits on the
Pk k (n k ) matrix message bits
H [I n k PT ]
Example (7,4)
Linear block codes – cont’d
r Ue
r (r1 , r2 ,...., rn ) received codeword or vector
e (e1 , e2 ,...., en ) error pattern or vector
• Syndrome testing:
– S is syndrome of r, corresponding to the error pattern e.
mGHT + eHT
S rHT eHT
Linear block codes – cont’d
U (101110) transmitted.
Error pattern Syndrome
000000 000 r (001110) is received.
000001 101 The syndrome of r is computed :
000010 011 S rH T (001110) H T (100)
000100 110
Error pattern corresponding to this syndrome is
001000 001
010000 010 eˆ (100000)
100000 100 The corrected vector is estimated
010001 111 ˆ r eˆ (001110) (100000) (101110)
U
Repetition Codes
• (n,1) code, eg. (5,1)
• G=[1111 1]
• H= 1000 1
0100 1
0010 1
0001 1
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
m2
Code length : n 2m 1
Number of information bits : k 2 m m 1
Number of parity bits : n-k m
Error correction capability : t 1
X iU(X) = X i ( u0 + u1X + ….. un-i-1X n-i-1 + un-iX n-i ….. + un-1X n-1 )
= un-i + un-i + un-iX n ….. + un-1 X i-1 + un-1 X i-1 + un-1 X n+i-1
g ( X ) g 0 g1 X ... g r X r
g(X) is a polynomial of degree n-k and is a factor of (Xn + 1)
nk
3. Add p ( X ) to X m( X to
) form the codeword U( X )
Cyclic block codes
1 1 0 1 0 0 0
0 1 0 0 1 0 1 1
1 1 0 1 0 0
G H 0 1 0 1 1 1 0
1 1 1 0 0 1 0
0 0 1 0 1 1 1
1 0 1 0 0 0 1
I 33 PT
P I 44
Cyclic block codes
• In the circuit, first the message flows to the shift register, and
feedback switch is set to ‘1’, where after check-bit-switch is
turned on, and the feedback switch to ‘0’, enabling the check
bits to be outputted .
Decoding cyclic codes:
syndrome table
correction
s ( x) mod r ( x) / g ( x)
Decoding circuit for (7,4) code
syndrome computation
received code x0 x1 xn-1 syndrome
0
received code 1 syndrome
G ( p) p 3 p 1
• To start with, the switch is at “0” position
• Then shift register is stepped until all the received code bits
have entered the register
• This results is a 3-bit syndrome (n - k = 3 ):
S( p ) mod R ( p) / G ( p)
that is then left to the register
• Then the switch is turned to the position “1” that drives the
syndrome out of the register.
Some block codes that can be
realized by cyclic codes
• (n,1) Repetition codes. High coding gain (minimum distance always n-1), but
very low rate: 1/n
• (n,k) Hamming codes. Minimum distance always 3. Thus can detect 2 errors and
correct one error. n=2m-1, k = n - m,
m3
• Maximum-length codes. For every integer there exists a maximum length
code (n,k) with n = 2k - 1,dmin = 2k-1. k 3
• BCH-codes. For every integer there exist a code with n = 2m-1,
and m error
where t is the 3 correction capability
• k nReed-Solomon
(n,k) mt d min (RS)
2t 1
codes. Works with k symbols that consists of m bits
that are encoded to yield code words of n symbols. For these codes
and
• d min BCH
Nowadays 2t and
1n RS 2are
m
1, number
very ofdue
popular check symbols
to large n knumber
dmin, large 2t of codes,
and easy generation
• Code selection criteria: number of codes, correlation properties, code gain,
code rate, error correction/detection properties.