Computing and Communications 2. Information Theory -Data - - PowerPoint PPT Presentation

computing and communications 2 information theory data
SMART_READER_LITE
LIVE PREVIEW

Computing and Communications 2. Information Theory -Data - - PowerPoint PPT Presentation

1896 1920 1987 2006 Computing and Communications 2. Information Theory -Data Compression Ying Cui Department of Electronic Engineering Shanghai Jiao Tong University, China 2017, Autumn 1 Outline Examples of codes Kraft inequality


slide-1
SLIDE 1

1896 1920 1987 2006

Computing and Communications

  • 2. Information Theory
  • Data Compression

Ying Cui Department of Electronic Engineering Shanghai Jiao Tong University, China 2017, Autumn

1

slide-2
SLIDE 2

Outline

  • Examples of codes
  • Kraft inequality for instantaneous codes
  • Kraft inequality for uniquely decodable codes
  • Optimal codes
  • Huffman codes

2

slide-3
SLIDE 3

Reference

  • Elements of information theory, T. M. Cover and J. A.

Thomas, Wiley

3

slide-4
SLIDE 4

EXAMPLES OF CODES

4

slide-5
SLIDE 5

Source Code

  • D-ary alphabet {0, 1, …, D-1}

5

slide-6
SLIDE 6

Examples

6

H(X) = 1.75 bits L(C) = 1.75 bits H(X)= L(X) H(X) = 1.58 bits L(C) = 1.66 bits H(X)< L(X)

slide-7
SLIDE 7

Conditions on Codes

  • Guarantee decodability of a single value of X?
  • Describe a sequence of values of X?

– example: if C(x1)=00 and C(x2)=11, then C(x1x2)=0011

7

slide-8
SLIDE 8

Conditions on Codes

  • Guarantee decodability of a sequence of values of X w/o

adding a special symbol between any two codewords?

  • Guarantee decodability of a sequence of values of X w/o

reference to future codewords?

– end of a codeword is immediately recognizable – an instantaneous code is a self-punctuating code – example: codewords C(1) = 0, C(2) = 10, C(3) = 110, C(4) = 111, binary string 01011111010 is parsed as 0, 10, 111, 110, 10

8

slide-9
SLIDE 9

Classes of Codes

9

decodability of a sequence of values of X w/o adding a special symbol between any two codewords decodability of a sequence of values of X w/o reference to future codewords decodability of a single value of X

slide-10
SLIDE 10

Example

– code 1: source of 0 can be 1, 2, 3, 4 – code 2: source sequence of 010 can be 2, 14, 31 – code 3: source sequence of 11…can be 3 (following bit is 1), 4 (following bits are 0’s of odd number), 3 (following bits are 0’s of even number) – code 4: prefix free

10

slide-11
SLIDE 11

KRAFT INEQUALITY FOR INSTANTANEOUS CODES

11

slide-12
SLIDE 12

Kraft Inequality

  • Wish to construct instantaneous codes of minimum

expected length to describe a given source

– cannot assign short codewords to all source symbols and still be prefix-free

12

slide-13
SLIDE 13

Idea of Proof

  • Consider a D-ary tree in which each node has D children. Let the branches
  • f the tree represent the symbols of the codeword. Each codeword is

represented by a leaf on the tree. The path from the root traces out the symbols of the codeword. The prefix condition on the codewords implies that no codeword is an ancestor of any other codeword on the tree.

13

1 1 1

slide-14
SLIDE 14

KRAFT INEQUALITY FOR UNIQUELY DECODABLE CODES

14

slide-15
SLIDE 15

McMillan Inequality

  • Expect uniquely decodable codes to offer further

possibilities for the set of codeword lengths than instantaneous codes

– class of uniquely decodable codes is larger – NO!

15

i

slide-16
SLIDE 16

OPTIMAL CODES

16

slide-17
SLIDE 17

Expected Code Length Minimization

17

continuous relaxation

  • ptimal

solution rounding up near optimal solution integer programming convex optimization

linear function convex function larger feasible set lower minimum value

slide-18
SLIDE 18

Expected Length

18

slide-19
SLIDE 19

Another Proof

19

slide-20
SLIDE 20

Minimum Expected Length

– there is an overhead of at most 1 bit due to the non- integer case – reduce the overhead per symbol by spreading it out over many symbols

20

slide-21
SLIDE 21

Minimum Expected Length per Symbol

  • Send a sequence of n symbols from X as a super

symbol with expected length

– i.i.d. case: entropy rate = H(x)

21

another justification for entropy rate: expected number

  • f bits per symbol required to

describe the process

slide-22
SLIDE 22

HUFFMAN CODES

22

slide-23
SLIDE 23

Huffman Algorithm

23

slide-24
SLIDE 24

Example

24

slide-25
SLIDE 25

Example

25

slide-26
SLIDE 26

Optimality of Huffman Code

26

slide-27
SLIDE 27

History of Huffman Code

In 1951, David A. Huffman (at the edge of 26) and his MIT information theory classmates were given the choice of a term paper or a final exam. The professor, Robert M. Fano, assigned a term paper on the problem of finding the most efficient binary

  • code. Huffman, unable to prove any codes were the most efficient,

was about to give up and start studying for the final when he hit upon the idea of using a frequency-sorted binary tree and quickly proved this method the most efficient. In doing so, Huffman outdid Fano, who had worked with information theory inventor Claude Shannon to develop a similar

  • code. Building the tree from the bottom up guaranteed optimality,

unlike top-down Shannon-Fano coding.

27

slide-28
SLIDE 28

Summary

28

slide-29
SLIDE 29

Summary

29