Lecture 24
Lecture 24
Lecture 24
EE140 Introduction to
Communication Systems
Lecture 24
Transmitter
Absent if
source is Noise Channel
digital
Receiver
1
3/4/2018
Contents
• Hamming codes
• Decoding of LBC
2
3/4/2018
• 000, 111
– Block length 3, 2, rate 1⁄3 log 2 0.333.
– Repetition code, can correct one bit error.
Hamming Distance
• The Hamming distance between -tuples is the
number of components in which the n-tuples differ
1, if
, ∑ , , where ,
0, if
– , 0 with equality if and only if (nonnegativity)
– , , (symmetry)
– , , , (triangle inequality)
– Hamming distance is a coarse or pessimistic measure of
difference.
• Other useful distances in error control coding:
– , distance on a circle, is applicable to phase
shift coding.
– , is used with sensewords in .
6
3
3/4/2018
Minimum Distance
• The minimum (Hamming) distance ∗ of a block
code is the minimum distance between any two
codewords:
∗ min , ∶ , are codewords and
• Properties of minimum distance:
– ∗ 1 since Hamming distance between distinct codewords
is a positive integer.
– ∗ if code has two or more codewords.
– ∗ 1 or ∗ ∞ for the useless code with only one
codeword. (This is a convention, not a theorem.)
– ∗ ∗ if ⊆ —smaller codes have larger (or
equal) minimum distance.
• The minimum distance of a code determines both
error-detecting ability and error-correcting ability.
7
Error-detecting Ability
• Suppose that a block code is used for error
detection only.
– If the received -tuple is not a codeword, a detectable error
has occurred
– If the received -tuple is a codeword but not the
transmitted codeword, an error has occurred that cannot be
detected.
4
3/4/2018
Error-correcting Ability
• We may think of a block code as a set of vectors
in an -dimensional space. The geometric intuition:
• Nearest-neighbor decoding
argmin , ∶ is a codeword
9
10
5
3/4/2018
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 is transmitted, senseword
is received, and ̂ is the decoder’s output. possible
outcomes:
– ̂ decoder success Successful correction
(including no errors)
– ̂ ? decoder failure Uncorrectable error detected,
no decision (not too bad)
– ̂ decoder error Miscorrection (very bad)
11
12
6
3/4/2018
13
14
7
3/4/2018
15
8
3/4/2018
Contents
• Hamming codes
• Decoding of LBC
17
Hamming Codes
• Parity check is simple but inefficient:
– a failed parity-check equation locates row or column of
error
– however, a satisfied equation gives little information
• Can we locate the error?
• (7, 4) Hamming parity check code (encoding rules)
18
9
3/4/2018
1 0 0 0 Systematic
0 1 0 0
0 0 1 0 0 0 0 1 1 1 1
G 0 0 0 1 , H 0 1 1 0 0 1 1
0 1 1 1 1 0 1 0 1 0 1
1 0 1 1
1 1 0 1
• Parity check
0
20
10
3/4/2018
– Coding efficiency:
22
11
3/4/2018
Exercise
• Given generator matrix G,
– Codewords
– Minimum distance
– Error control ability
1 0 0
0 1 0
0 0 1
G
1 0 1
0 1 1
1 1 0
23
Exercise (cont’d)
• Extended Hamming codes: add an overall parity-
check bit
,
– Codewords
– Minimum distance
– Error control ability
24
12
3/4/2018
Contents
• Hamming codes
• Decoding of LBC
25
Minimum Weight
• The Hamming weight is the number of
nonzero components of .
• Facts:
– 0,
– 1, 2 1 2 2 1
– 0 if and only if 0
• Definition: The minimum (Hamming) weight of a
block code is the weight of the nonzero codeword
with smallest weight:
∗
min min ∶ ∈ , 0
• Examples of minimum weight:
– Simple parity-check codes: ∗ 2.
– Repetition codes: ∗ .
– (7,4) Hamming code: ∗ 3. 26
13
3/4/2018
27
Generator Matrix
• Definition: A generator matrix for a linear block
code of blocklength and dimension is any
matrix whose rows form a basis for .
• Every codeword is a linear combination of the
columns of a generator matrix :
u0
u
c Gu g 0 g1 L g k 1 nk 1
M
uk 1
28
14
3/4/2018
Parity-check Matrix
• Definition: The dual code of is the orthogonal
complement C .
• Definition: A parity-check matrix for a linear block
code is any matrix , whose rows span the
orthogonal complement C . Obviously, .
• Example: and for 5, 4 simple parity-check
code.
1 0 0 0
1 1 0 0
G 0 1 1 0 , H 1 1 1 1 1
0 0 1 1
0 0 0 1
– is generator matrix for 5, 1 repetition code - the dual code
29
Example
• 7, 4 Hamming code
1 0 0 0
0 1 0 0
0 0 1 0 0 0 0 1 1 1 1
G 0 0 0 1 , H 0 1 1 0 0 1 1
0 1 1 1 1 0 1 0 1 0 1
1 0 1 1
1 1 0 1
30
15
3/4/2018
31
16
3/4/2018
Contents
• Hamming codes
• Decoding of LBC
33
17
3/4/2018
36
18
3/4/2018
37
Example
38
19
3/4/2018
Contents
• Hamming codes
• Decoding of LBC
• Example LBC
– Cyclic code,
– BCH code,
– R-S code
39
40
20
3/4/2018
Example
• Example generator matrix
41
Basic Properties
• By iteration, all cyclic shifts of codewords are
codewords; thus the right cyclic shift positions of
any codeword c(x) is a codeword:
mod 1
• Since cyclic codes are linear, sums of cyclic shifts
are codewords; thus for any polynomial
,
mod 1 mod 1
is a codeword.
42
21
3/4/2018
43
44
22
3/4/2018
45
– Generator polynomial: 1 1 1
– Minimum distance for CRC-16, CRC-CCITT is 4. Both codes
correct single errors while detecting double errors, or detect
up to 3 errors.
• CRC-CCITT
– Generator polynomial: 1 1 ⋯
⋯ 1
46
23
3/4/2018
Contents
• Hamming codes
• Decoding of LBC
• Example LBC
– Cyclic code,
– BCH code,
– R-S code
47
BCH Introduction
• BCH codes, which are cyclic code, were first
discovered by A. Hocquenghem in 1959 and
independently by R. C. Bose and D. K. Chaudhuri in
1960.
48
24
3/4/2018
BCH Introduction
• The code is designed according to the error-
correcting ability, which is different from the linear
block codes discussed before.
49
Example I
• GF(24) generated by the primitive polynomial
1 over GF(2).
• Correct 1 bit error 1, 15.
• Generate polynomial
,
1, 1
1
• Degree of 4, so we have generate
polynomil for 1 bit error correcting 15,11 .
• Hamming distance of codewords 2 1 3.
50
25
3/4/2018
Example II
• GF(24) generated by the primitive polynomial
1 over GF(2).
• Correct 2 bit error 2, 15.
• Generate polynomial
, , ,
1, 1,
1, 1
1
• Degree of 8, so we have generate
polynomil for 2 bit error correcting 15,7 .
• Hamming distance of codewords 2 1 5.
51
Contents
• Hamming codes
• Decoding of LBC
• Example LBC
– Cyclic code,
– BCH code,
– R-S code
52
26
3/4/2018
RS Introduction
• The RS codes are nonbinary cyclic codes with code
symbols from a Galois field. They were discovered
in 1960 by . and . . The work was
done when they were at MIT Laboratory.
53
RS Codes
54
27
3/4/2018
Example
• Construct a 3, 15, 4 RS code.
– Distance: 2 1 7 28
– Parity check: 2 6 24
– Information: 6 9 36
– Length of codeword: 15 60
– This is (15,9) RS code, regard as a (60,36) binary code.
– Generate matrix:
– …
1
– is a element of 2
55
56
28
3/4/2018
Questions?
57
29