Textbook coverage
Chapters 1 through 8 and 12 of Algebraic Codes for Data Transmission:
1. Introduction to error control codes
2. Introduction to algebra: groups, rings, vector spaces, Galois (finite) fields
3. Linear block codes: matrices, syndromes, weight distributions
4. Galois field structure and arithmetic
5. Cyclic codes: generator polynomials, shift registers
6. BCH and Reed-Solomon codes: definitions and properties
7. BCH and Reed-Solomon codes: decoders for errors and erasures
8. Implementation of Galois field arithmetic and shift register decoders
12. Product codes; coding gain
Source Channel
Source Encrypt Modulator
Encoder Encoder
Channel Noise
Source Channel
Sink Decrypt Demodulator
Decoder Decoder
n1 , n2 , . . .
The raw error rate is defined to be the fraction of incorrect senseword symbols.
n
1X
lim P(xi 6= yi)
n→∞ n
i=1
Encoder Encoder
(general) (systematic)
c1i = mi
c2i = mi + mi−1
• Memory subsystems (9-bit SIMMs for detection, 72-bit DIMMs for correction).
• Modems. V.32/V.90 use trellis codes. V.42 uses error detection with
retransmission.
• Magnetic disks and tapes (detection for soft errors, correction for burst errors).
• Satellite TV.
Coding schemes
The above examples exhibit a range of data rates, block sizes, error rates.
• No single error protection scheme works for all applications.
• Some applications use multiple coding techniques.
A common combination uses an inner convolutional code and an outer
Reed-Solomon code.
• Choosing a good coding scheme may be difficult because error characteristics
are not known.
Common solution: fall back on methods that correct multiple classes of errors.
Disadvantage: may not be “optimal” for any particular environment.
1
The ternary alphabet is used by alternate mark inversion modulation; successive ones in data are represented by
alternating ±1.
EE 387 Notes #1, Page 15
Systematic encoder
The error protection ability of a block code depends only on the set of codewords,
not on the mapping from source messages to codewords.
But obviusly an encoder is needed for practical applications.
Minimum distance
The minimum (Hamming) distance d∗ of a block code is the distance between any
two closest codewords:
d∗ = min { dH (c1, c2) : c1, c2 are codewords and c1 6= c2 }
Some obvious properties of minimum distance of a code of blocklength n:
• d∗ ≥ 1 since Hamming distance between distinct codewords is a positive integer.
• d∗ ≤ n if code has two or more codewords.
• d∗ = n + 1 or d∗ = ∞ for the useless code with only one codeword.
(This is a convention, not a theorem.)
• d∗(C1) ≥ d∗(C2) if C1 ⊆ C2 — smaller codes have larger (or equal) minimum
distance.
The minimum distance of a code determines both its error-detecting ability and
error-correcting ability.
Error-correcting ability
We may think of a block code as a set of M vectors in an n-dimensional space.
The geometry of the space is defined by Hamming distance — quite different from
Euclidean geometry. Nonetheless, geometric intuition can be useful.
d*
decoding
spheres
decoding
regiion
decoding
spheres
decoding
regiion
The maximal decoding region is usually larger than the decoding sphere.
Most decoders correct only when senseword r belongs to a decoding sphere of
radius t. They are called bounded-distance decoders.
Decoding outcomes
A particular block code can have more than one decoder, depending on
• the type of errors expected or observed
• the error rate
• the computational power available at the decoder
Suppose that codeword c is transmitted, senseword r is received, and ĉ is the
decoder’s output. The table below classifies the outcomes.
ĉ = c decoder success Successful correction (including no errors)
ĉ = ? decoder failure Uncorrectable error detected, no decision (not too bad)
ĉ 6= c decoder error Miscorrection (very bad)
Important: the decoder cannot distinguish the outcome ĉ = c from ĉ 6= c.
However, it can assign probabilities to the possibilities; more bit errors corrected
suggests a higher probability that the estimate is wrong.
The subscript “ued” can be read as “uncorrectable error detected,” whereas “ue” is “undetected error.”
P
Any bit ci can be considered to be the check bit because it can be computed from the other n − 1 bits: ci = j6=i cj .
X n k
Exercise: P{odd number of errors} = ǫ (1 − ǫ)n−k = 12 − 21 (1 − 2ǫ)n .
k odd k
EE 387 Notes #1, Page 30
Example: nonbinary simple check codes
Suppose we have defined an addition operation on a nonbinary alphabet, modulo 5
addition for alphabet {0, 1, 2, 3, 4}.
A block code can be defined by the single check equation or by the corresponding
encoding equation:
c1 + c2 + · · · + cn = 0 ⇔ cn = − c1 − c2 − · · · − cn−1 .
This code can detect all single symbol errors and most error patterns with two or
more symbol errors.
Some addition operations are better than others. For 8-bit symbols:
• 8-bit parallel exclusive: two bit errors in the same bit position in two different
bytes cannot be detected. Very bad.
• For 8-bit unsigned addition, two errors in the same bit positions are detected
when they change the value of the carry into the next bit position. Bad.
• Ones-complement arithmetic is a better choice for the addition operator (used
in the Fletcher’s OSI checksum). Better.
A single error causes failure of one row equation and one column equation.
The incorrect bit is located at the intersection of the bad row and bad column.
Double errors can be detected — two rows or two columns (or both) have the
wrong parity — but cannot be corrected.
Some triple errors cause miscorrection. Which?
Almost all multiple errors can be detected — product code has lots of redundancy.
Exercise: what fraction of errors is not detected?
The 1’s indicate which codeword bits affect which parity-check equations.
We could choose other sets of check bits, such as {c2, c3, c4}.
Not all sets work. In particular, c1, c2, c3 cannot be determined from c4, c5, c6, c7
since the leftmost 3 columns of H form a singular (not invertible) matrix.
When s = 0, the decoder assumes that no error has occurred. This is the most
likely conclusion under reasonable assumptions.
Each nonzero value of s corresponds to an error in a different one of 23 − 1 = 7 bit
positions. If a single error has occurred, the syndrome identifies its location.
For this particular parity-check matrix H , the syndrome s = [ s0 s1 s2 ] is the binary representation of the assumed
error location (most significant bit is s2 ).
n2 − k2
4 4
4 data
Product code parameters: (n, k, d∗) = (64, 16, 16). Rate: 1/4
Error correcting ability: t = ⌊(16 − 1)/2)⌋ = 7
Product codes can be decoded up to the guaranteed error correcting ability.
The decoding procedure requires a column decoder that can correct both errors
and erasures. (Blahut chapter 12.)
We will find more efficient codes; e.g., the (64,25,16) expanded BCH code needs
only 39 check bits for same minimum distance.
The syndrome tells exactly what should be subtracted from the incorrect symbol in
order to obtain a codeword.
What is not known is where the error is — which symbol is wrong.
Decoding procedure
Suppose there is a single error of magnitude ei 6= 0 in location i. The syndrome
s = [ s0 s1 ] can be expressed in terms of the unknowns i and ei:
n
X n
X
s0 = rj = ei + cj = ei
j=1 j=1
Xn Xn
s1 = jrj = iei + jcj = iei
j=1 j=1
Reed-Solomon codes
The previous codes over GF(16) and GF(17) are examples of Reed-Solomon codes.
Reed-Solomon codes use symbols from a finite field GF(Q) and have n = Q − 1.
Each row of H consists of consecutive powers of elements of GF(Q).
When the elements are chosen carefully, each additional check equation increases
the minimum distance by 1.
For example, the following parity-check matrix corresponds to 4 equations:
1 1 1 1 ··· 1 1 1 1 1 ··· 1
1 2 3 4 ··· 16 1 2 3
4 · · · 16
H= 1 4 9 =
16 · · · 256 1 4 9 16 · · · 1
1 8 27 64 · · · 4096 1 8 10 13 · · · 16
This PC matrix defines a code over GF(17) with minimum distance 5. It can
correct two symbol errors in a codeword of length 16.
Decoding procedures for Reed-Solomon codes are the chief goal of this course.
Channel Channel
Modulator Channel Demodulator
Encoder Decoder
Noise
The modulator converts the digital output of the channel encoder into waveforms
suitable for transmission over the physical channel, while the demodulator
estimates digital values from the received waveforms.
The channel coding scheme should take into account the modulation method.
However, once the channel code has been chosen, we can include the
modulator/demodulator in the channel block. We get a simplified channel model.
Noise
Noise
2
Robert Gallager, a famous researcher in information theory, stated in a talk at Stanford that he had never met a
binary symmetric channel. He meant that most channels have correlated noise.
EE 387 Notes #1, Page 51
0.9
entropy
capacity ber H(ber) C(ber)
−1
0.8 10 0.46899559358928 0.53100440641072
0.7 10−2 0.08079313589591 0.91920686410409
0.6 10−3 0.01140775773746 0.98859224226254
0.5 10−4 0.00147303352833 0.99852696647167
0.4 10−5 0.00018052328302 0.99981947671698
0.3
10−6 0.00002137426289 0.99997862573711
0.2
10−7 0.00000246961916 0.99999753038084
0.1
10−8 0.00000028018120 0.99999971981880
0
10−9 0.00000003134005 0.99999996865995
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
For two errors, dH (c, r) = 2 and decoder miscorrection causes dH (c, ĉ) = 3.
The bit error rate measured between c and ĉ is P{2 errors} · 3/7.
It can be shown that for the systematic encoder, the mistakes in ĉ are distributed
uniformly over the 7 codeword bits.
Matlab confirms: P{3 errors} = 4.5 × 10−12 ≪ 4.6 × 10−8 = P{2 errors}.
So for homework #1 problem #5 we can ignore ≥ 3 errors.
EE 387 Notes #1, Page 55
noise n1 , n2 , . . .
In the simplest version of this model, the bit error rate is 0 in the good state and
1/2 in the bad state, resulting in a burst of errors.
EE 387 Notes #1, Page 56
Error model example
Suppose a combination of random (1-bit) and burst (45-bit) errors.
P{random error} = 10−6 , P{burst error} = 4 × 10−7
1
The raw bit error rate is 1 · 10−6 + 2 · 45 · 4 × 10−7 = 10−5.
Suppose 1000-bit packets and we require bit error rate after correction 10−12.
To achieve this with a random error correcting code, we consider
(1000 · 10−5)5 10−10
P{5 errors} ≈ = ≈ 0.83 × 10−12
5! 120
Correcting 5 random errors would be sufficient if only random errors occurred.
But packets with 45-bit bursts cannot be corrected. Burst errors contribute about
9 × 10−6 ≫ 10−12 to the final error rate.
Furthermore, correcting 5 random errors is overkill.
(1000 · 10−6)4 10−12
P{4 errors | no burst} ≈ = ≈ 4.2 × 10−14
4! 24
We need a method for correcting a mixture of random and burst errors.
EE 387 Notes #1, Page 57
• Use a code that corrects symbols errors, where symbols contain multiple bits.
A Reed-Solomon code with 10-bit channel symbols has blocklength 210 − 1
symbols or 10230 bits. With 500 check bits, we can correct any pattern of
errors confined to 25 symbols. In particular, a 45-bit burst affects at most 6
symbols, so multiple bursts–up to 4–can be corrected.