ETN3046 Chapter 6
ETN3046 Chapter 6
1
Shannon’s Capacity Theorem
2
Shannon’s Capacity Theorem
S Eb Rb
C = B log 2 1 + = B log 2 1 +
N No B
When Rb = C
Rb Eb Rb
= log2 1 + …………….. [6.3]
B No B
3
Shannon’s Capacity Theorem
Example 6.1:
5
Information
message n
source message i with pi , i = 1 to n pi = 1
i =1
1
message i = log 2 = − log 2 pi bits ………….. [6.4]
pi
message i
(information) message i = –log2 pi
pi (probability)
0 1
7
Entropy
8
Entropy
Example 6.2:
9
Shannon-Fano Coding
10
Shannon-Fano Coding
0 S1 S2 S3 S4 1
S1 S2 S3 S4
0 1
S2 S3 S4
0 1
Symbol Prob. S-F Word Length
Si pi Codeword Li S3 S4
S1 0.4 0 1 bit
S2 0.3 10 2 bits
S3 0.2 110 3 bits
S4 0.1 111 3 bits
11
Shannon-Fano Coding
Example 6.3:
Symbol Si Prob. pi
S1 0.4
S2 0.2
S3 0.2
S4 0.1
S5 0.1
13
Huffman Coding
Symbol Si Prob pi
S1 0.4 0.4 0.4 0.6 0
S2 0.2 0.2 0.4 0 0.4 1
S3 0.2 0.2 0 0.2 1
S4 0.1 0 0.2 1
S5 0.1 1
Symbol Si Prob. pi Huffman Codeword Word Length Li
S1 0.4 00 2 bits
S2 0.2 10 2 bits
S3 0.2 11 2 bits
S4 0.1 010 3 bits
S5 0.1 011 3 bits 15
Huffman Coding
17
Huffman Coding
Example 6.4:
18
Error Control Coding
19
Error Control Coding
ETN3046
21
Linear Block Codes
The block codes studied above have the information bits appear
in the codeword unchanged with some parity bits added.
In this case, the code is said to be systematic.
Information Codeword
00 00000
01 01011
10 10101
11 11110
n-bit codeword
Figure 6.2 – An (n, k) linear block code
24
Hamming Codes
1 1 0
1 0 1
QT =
0 1 1
1 1 1
1 0 0 0 1 1 0
0 1 1 0 1 1 0 0
1 0 0 1 0 1
G= , H = 1 0 1 1 0 1 0
0 0 1 0 0 1 1
0 1 1 1 0 0 1
0 0 0 1 1 1 1
26
Hamming Codes
Encoding Algorithm
For encoding,
uG = v ………….. [6.10]
where v is the vector of the encoded bits, u is the vector of k
information bits. The summation is performed using modulo-
2 addition.
27
Hamming Codes
1 0 0 0 1 1 0
0 1 0 0 1 0 1
uG = [1 0 1 0]
0 0 1 0 0 1 1
0 0 0 1 1 1 1
= (1 ⊕ 0 ⊕ 0 ⊕ 0)(0 ⊕ 0 ⊕ 0 ⊕ 0)(0 ⊕ 0 ⊕ 1 ⊕ 0)(0 ⊕ 0 ⊕ 0 ⊕ 0)
(1 ⊕ 0 ⊕ 0 ⊕ 0)(1 ⊕ 0 ⊕ 1 ⊕ 0)(0 ⊕ 0 ⊕ 1 ⊕ 0)
=1 0 1 0 1 0 1
28
Hamming Codes
29
Hamming Codes
30
Hamming Codes