ECEN 5682 Theory and Practice of Error Control Codes: Introduction To Block Codes
ECEN 5682 Theory and Practice of Error Control Codes: Introduction To Block Codes
Peter Mathys
University of Colorado
Spring 2007
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Basic Definitions
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
r = n − logq M .
This code has rate R = log5 5/4 = 1/4 = 0.25 and redundancy
r = 4 − log5 5 = 3 symbols.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
The goal when using error control codes is to detect and/or correct
transmission errors. Suppose code #1 is used and the (corrupted)
codeword v = (00101) is received. Comparing v with all “legal”
codewords and marking the discrepancies with * yields:
To decide which error out of a set of errors is the “right” one, one
needs to make additional assumptions about the likelihood of
errors and error patterns. The two most common models for the
occurrence of errors are:
(i) Independent and identically distributed (iid) errors with
probablity . This requires a memoryless transmission channel
model.
(ii) Burst errors of length L. If an error occurs, it is very likely
that it is followed by L − 1 more errors. Burst errors occur for
instance in mobile communications due to fading and in
magnetic recording due to media defects. Burst errors can be
converted to iid errors by the use of an interleaver.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
More generally, and especially for non-binary codes, one also needs
a model for the error amplitudes. Two possibilities are
(i) Uniformly distributed non-zero error amplitudes. This is a
good model for orthogonal signaling.
(ii) Non-uniformly distributed non-zero error amplitudes with
smaller error magnitudes more likely than larger ones. This is
a good model for QAM signaling.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
c v =c+e
+
codeword received
vector addition codeword
(often modulo q)
1−
1 • • 1
Input Output
X Y
0 • • 0
1−
pY |X (0|0) = 1 − , pY |X (1|0) = ,
pY |X (0|1) = , pY |X (1|1) = 1 − .
Thus, if < 0.5 on a memoryless BSC, fewer errors are more likely
and the “right” error pattern is the one with the fewest number of
1’s in it. Note that, since all symbols are binary here, only errors of
amplitude 1 are possible and no specification for the distribution of
error amplitudes is needed.
In this case the decoding rule assumes again that the “right” error
pattern is the one with the fewest nonzero symbols in it.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Now the decoder decides on the error pattern with the fewest
number of ±1 (mod 5) symbols as the “right” error.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
For the iid error model with (discrete) uniform error amplitude
distribution the most appropriate measure is Hamming distance
which is defined as follows.
Definition: The Hamming distance d (H) (x, y) (or simply d(x, y))
between two q-ary n-tuples x and y is the number of places in
which they differ.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
(H) (L)
Thus, for code #2, dmin = 4 and dmin = 6.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
St (c) = {v | d(c, v) ≤ t} ,
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Note: Don’t take the name “perfect code” too literally. Perfect
just simply means that the spheres of radius t = (dmin − 1)/2
around all codewords fill out the whole codewordspace perfectly. It
does not necessarily mean that perfect codes are the best error
detecting and/or correcting codes.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
The selection of the coset leaders for the last two rows is not
unique. For example, 11000 and 10010 could have been used
instead of 00110 and 01100.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
C ⊥ = {u ∈ V | u · w = 0 for all w ∈ C} .
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Corollary: A linear code C has minimum weight wmin iff every set
of wmin − 1 columns of H is linearly independent and at least one
set of wmin columns of H is linearly dependent.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Multiply the first row by 6−1 = 2. Then replace the second row by the
difference of the second row minus the new first row. Next, subtract 2 times
the new first row from the third row and replace the third row with the result
to obtain 2 3
1 7 2 9 1 9 4 0
0
A = 40 0 2 0 9 1 4 6 5 .
0 0 5 0 6 8 10 4
Now start by multiplying the second row by 2−1 = 6. Then subtract 2 times
this row from the first row. Finally, note that the third row is just a multiple of
the second row, so that it can be replaced by an all zero row. The result is A in
row-echelon form:
2 3
1 7 0 9 3 8 0 5
00
A = 40 0 1 0 10 6 2 35 .
0 0 0 0 0 0 0 0
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
G = [Ik | P] , or G = [P | Ik ] ,
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
dmin = n − k + 1 ,
Note: The name maximum distance separable code comes from the fact that
such a code has the maximum possible (Hamming) distance between
codewords and that the codeword symbols can be separated into data symbols
and parity check symbols (i.e., the code has a systematic encoder).
Example: Code #6. The ternary (4, 2) code with generator matrix
» –
1 0 2 2
G= ,
0 1 2 1
From this it is easily seen that dmin = 3 = n − k + 1, which proves the claim
that this code is MDS.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Error e Syndrome s
00000 000
00001 001 2 3
00010 010 1 0 1 0 0
00100 100 H = 40 1 0 1 05
01000 011 1 1 0 0 1
01000 101
00110 110
01100 111
Note that an incomplete (or bounded distance) decoder would only use the first
six entries (above the dividing line at the bottom) for decoding. The choice of
the error patterns for the last two entries is somewhat arbitrary (just as it was
in the case of the standard array), and other double error patterns that yield
the same syndromes could have been used. Suppose now that v = (11101) was
received. To decode v, compute s = v HT = (011). From the syndrome lookup
table the corresponding e = (01000). Finally, the corrected codeword c is
obtained as c = v − e = (10101).
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Example: Natural parameters (n, k, dmin ) of commonly used small binary linear
codes are:
(7, 4, 3)
(15, 11, 3) (15, 7, 5) (15, 5, 7)
(23, 12, 7)
(31, 26, 3) (31, 21, 5) (31, 16, 7) (31, 11, 11)
(63, 57, 3) (63, 51, 5) (63, 45, 7) (63, 39, 9) (63, 36, 11)
(127, 120, 3) (127, 113, 5) (127, 106, 7) (127, 99, 9) (127, 92, 11)
(255, 247, 3) (255, 239, 5) (255, 231, 7) (255, 223, 9) (255, 215, 11)
Note that most of the block lengths of these codes are of the form 2m − 1 for
some integer m. Such block lengths are called primitive block lengths.
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes
Basic Definitions
Introduction to Block Codes
Linear Block Codes
d(x, y) = w (u − u0 ) + w (u − u0 + v − v0 ) ,
Peter Mathys ECEN 5682 Theory and Practice of Error Control Codes