Compu&ng and Communica&ons 2. Informa&on Theory - - PowerPoint PPT Presentation

compu ng and communica ons 2 informa on theory data
SMART_READER_LITE
LIVE PREVIEW

Compu&ng and Communica&ons 2. Informa&on Theory - - PowerPoint PPT Presentation

1896 1920 1987 2006 Compu&ng and Communica&ons 2. Informa&on Theory -Data Compression Ying Cui Department of Electronic Engineering Shanghai Jiao Tong


slide-1
SLIDE 1

1896 1920 1987 2006

Compu&ng ¡and ¡Communica&ons ¡

  • 2. Informa&on ¡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 ¡
  • KraJ ¡inequality ¡for ¡instantaneous ¡codes ¡
  • KraJ ¡inequality ¡for ¡uniquely ¡decodable ¡codes ¡
  • Op&mal ¡codes ¡
  • Huffman ¡codes ¡

2

slide-3
SLIDE 3

Reference

  • Elements ¡of ¡informa&on ¡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) ¡= ¡1.58 ¡bits ¡ ¡ L(C) ¡= ¡1.66 ¡bits

slide-7
SLIDE 7

Condi&ons ¡on ¡Codes

  • Guarantee ¡an ¡unambiguous ¡descrip&on ¡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

Condi&ons ¡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-­‑punctua&ng ¡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

slide-10
SLIDE 10

Classes ¡of ¡Codes

¡ ¡ ¡ ¡ ¡ ¡ ¡

– code ¡1: ¡source ¡of ¡0 ¡can ¡be ¡1, ¡2, ¡3, ¡4 ¡ – code ¡2: ¡source ¡sequence ¡of ¡010 ¡can ¡be ¡2, ¡14, ¡31 ¡ – code ¡3: ¡first ¡two ¡bits ¡of ¡a ¡code ¡string ¡are ¡11 ¡

  • following ¡bit ¡is ¡1: ¡first ¡src ¡symbol ¡is ¡3; ¡following ¡bits ¡are ¡0’s ¡of ¡odd ¡

number: ¡first ¡src ¡symbol ¡is ¡4; ¡of ¡even ¡number: ¡first ¡src ¡symbol ¡is ¡3 ¡

– code ¡4: ¡prefix ¡free

10

slide-11
SLIDE 11

KRAFT ¡INEQUALITY ¡FOR ¡ INSTANTANEOUS ¡CODES

11

slide-12
SLIDE 12

KraJ ¡Inequality

  • Wish ¡to ¡construct ¡instantaneous ¡codes ¡of ¡minimum ¡

expected ¡length ¡to ¡describe ¡a ¡given ¡source ¡

– cannot ¡assign ¡short ¡codewords ¡to ¡all ¡source ¡symbols ¡and ¡ s&ll ¡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 ¡condi&on ¡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 ¡

possibili&es ¡for ¡the ¡set ¡of ¡codeword ¡lengths ¡than ¡ instantaneous ¡codes ¡

– class ¡of ¡uniquely ¡decodable ¡codes ¡is ¡larger ¡ – NO!

15

slide-16
SLIDE 16

OPTIMAL ¡CODES

16

slide-17
SLIDE 17

Expected ¡Code ¡Length ¡Minimiza&on

17

con&nuous ¡ relaxa&on

  • p&mal ¡

solu&on rounding ¡up ¡ near ¡op&mal ¡ solu&on integer ¡programming convex ¡op&miza&on

slide-18
SLIDE 18

Expected ¡Length

18

slide-19
SLIDE 19

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

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

Op&mality ¡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 ¡ informa&on ¡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 ¡ informa&on ¡theory ¡inventor ¡Claude ¡Shannon ¡to ¡develop ¡a ¡similar ¡

  • code. ¡Building ¡the ¡tree ¡from ¡the ¡bolom ¡up ¡guaranteed ¡op&mality, ¡

unlike ¡top-­‑down ¡Shannon-­‑Fano ¡coding.

27

slide-28
SLIDE 28

Summary

28

slide-29
SLIDE 29

Summary

29