DCSP-3: Minimal Length Coding. Jianfeng Feng

Similar documents
Chapter 3 Source Coding. 3.1 An Introduction to Source Coding 3.2 Optimal Source Codes 3.3 Shannon-Fano Code 3.4 Huffman Code

Chapter 2: Source coding

Entropy as a measure of surprise

Chapter 2 Date Compression: Source Coding. 2.1 An Introduction to Source Coding 2.2 Optimal Source Codes 2.3 Huffman Code

An instantaneous code (prefix code, tree code) with the codeword lengths l 1,..., l N exists if and only if. 2 l i. i=1

Lecture 1: September 25, A quick reminder about random variables and convexity

10-704: Information Processing and Learning Fall Lecture 10: Oct 3

COMM901 Source Coding and Compression. Quiz 1

3F1 Information Theory, Lecture 3

Lecture 16. Error-free variable length schemes (contd.): Shannon-Fano-Elias code, Huffman code

U Logo Use Guidelines

3F1 Information Theory, Lecture 3

Bandwidth: Communicate large complex & highly detailed 3D models through lowbandwidth connection (e.g. VRML over the Internet)

Lecture 1: Shannon s Theorem

Chapter 5: Data Compression

Motivation for Arithmetic Coding

Communications Theory and Engineering

Data Compression Techniques (Spring 2012) Model Solutions for Exercise 2

1 Introduction to information theory

Source Coding. Master Universitario en Ingeniería de Telecomunicación. I. Santamaría Universidad de Cantabria

SIGNAL COMPRESSION Lecture Shannon-Fano-Elias Codes and Arithmetic Coding

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

ECE Advanced Communication Theory, Spring 2009 Homework #1 (INCOMPLETE)

1 Ex. 1 Verify that the function H(p 1,..., p n ) = k p k log 2 p k satisfies all 8 axioms on H.

Multimedia Communications. Mathematical Preliminaries for Lossless Compression

EE376A: Homework #3 Due by 11:59pm Saturday, February 10th, 2018

Information & Correlation

Huffman Coding. C.M. Liu Perceptual Lab, College of Computer Science National Chiao-Tung University

CSCI 2570 Introduction to Nanocomputing

Coding of memoryless sources 1/35

Coding for Discrete Source

PART III. Outline. Codes and Cryptography. Sources. Optimal Codes (I) Jorge L. Villar. MAMME, Fall 2015

Homework Set #2 Data Compression, Huffman code and AEP

Information and Entropy

Intro to Information Theory

Information Theory CHAPTER. 5.1 Introduction. 5.2 Entropy

Introduction to Information Theory. By Prof. S.J. Soni Asst. Professor, CE Department, SPCE, Visnagar

EE376A - Information Theory Midterm, Tuesday February 10th. Please start answering each question on a new page of the answer booklet.

10-704: Information Processing and Learning Fall Lecture 9: Sept 28

Multimedia. Multimedia Data Compression (Lossless Compression Algorithms)

Chapter 9 Fundamental Limits in Information Theory

Optimal codes - I. A code is optimal if it has the shortest codeword length L. i i. This can be seen as an optimization problem. min.

UNIT I INFORMATION THEORY. I k log 2

Run-length & Entropy Coding. Redundancy Removal. Sampling. Quantization. Perform inverse operations at the receiver EEE

Uncertainity, Information, and Entropy

ELEC 515 Information Theory. Distortionless Source Coding

EE5585 Data Compression January 29, Lecture 3. x X x X. 2 l(x) 1 (1)

Exercises with solutions (Set B)

Lec 03 Entropy and Coding II Hoffman and Golomb Coding

Information Theory and Statistics Lecture 2: Source coding

Lecture 3 : Algorithms for source coding. September 30, 2016

EE5139R: Problem Set 4 Assigned: 31/08/16, Due: 07/09/16

Shannon-Fano-Elias coding

Introduction to information theory and coding

Lecture 6: Kraft-McMillan Inequality and Huffman Coding

Information Theory. Week 4 Compressing streams. Iain Murray,

Basic Principles of Lossless Coding. Universal Lossless coding. Lempel-Ziv Coding. 2. Exploit dependences between successive symbols.

6.02 Fall 2012 Lecture #1

4F5: Advanced Communications and Coding Handout 2: The Typical Set, Compression, Mutual Information

Data Compression Techniques

lossless, optimal compressor

Lecture 3. Mathematical methods in communication I. REMINDER. A. Convex Set. A set R is a convex set iff, x 1,x 2 R, θ, 0 θ 1, θx 1 + θx 2 R, (1)

Lecture 11: Quantum Information III - Source Coding

Kolmogorov complexity ; induction, prediction and compression

An introduction to basic information theory. Hampus Wessman

Lecture 4 : Adaptive source coding algorithms

2018/5/3. YU Xiangyu

Summary of Last Lectures

Data Compression. Limit of Information Compression. October, Examples of codes 1


Chapter 4. Data Transmission and Channel Capacity. Po-Ning Chen, Professor. Department of Communications Engineering. National Chiao Tung University

Lecture 1 : Data Compression and Entropy

Digital Communications III (ECE 154C) Introduction to Coding and Information Theory

Chapter 2 Source Models and Entropy. Any information-generating process can be viewed as. computer program in executed form: binary 0

Entropy and Ergodic Theory Lecture 3: The meaning of entropy in information theory

A Mathematical Theory of Communication

Information and Entropy. Professor Kevin Gold

Outline. Computer Science 418. Number of Keys in the Sum. More on Perfect Secrecy, One-Time Pad, Entropy. Mike Jacobson. Week 3

EE376A: Homework #2 Solutions Due by 11:59pm Thursday, February 1st, 2018

Compression and Coding

ECE 564/645 - Digital Communications, Spring 2018 Midterm Exam #1 March 22nd, 7:00-9:00pm Marston 220

Lecture 4 Channel Coding

Digital communication system. Shannon s separation principle

Entropy Coding. Connectivity coding. Entropy coding. Definitions. Lossles coder. Input: a set of symbols Output: bitstream. Idea

CSEP 590 Data Compression Autumn Arithmetic Coding

EECS 229A Spring 2007 * * (a) By stationarity and the chain rule for entropy, we have

Chapter 5. Data Compression

to mere bit flips) may affect the transmission.

MAHALAKSHMI ENGINEERING COLLEGE-TRICHY QUESTION BANK UNIT V PART-A. 1. What is binary symmetric channel (AUC DEC 2006)

Introduction to Information Theory. Part 2

CS4800: Algorithms & Data Jonathan Ullman

Information Theory. David Rosenberg. June 15, New York University. David Rosenberg (New York University) DS-GA 1003 June 15, / 18

4. Quantization and Data Compression. ECE 302 Spring 2012 Purdue University, School of ECE Prof. Ilya Pollak

MAHALAKSHMI ENGINEERING COLLEGE QUESTION BANK. SUBJECT CODE / Name: EC2252 COMMUNICATION THEORY UNIT-V INFORMATION THEORY PART-A

EE376A - Information Theory Final, Monday March 14th 2016 Solutions. Please start answering each question on a new page of the answer booklet.

Solutions to Set #2 Data Compression, Huffman code and AEP

TTIC 31230, Fundamentals of Deep Learning David McAllester, April Information Theory and Distribution Modeling

Lecture 16 Oct 21, 2014

17.1 Binary Codes Normal numbers we use are in base 10, which are called decimal numbers. Each digit can be 10 possible numbers: 0, 1, 2, 9.

Source Coding Techniques

Transcription:

DCSP-3: Minimal Length Coding Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk http://www.dcs.warwick.ac.uk/~feng/dcsp.html

Automatic Image Caption (better than human)

This Week s Summary: get familiar with 0 and 1 Information theory Huffman coding: code events as economic as possible

Information sources X = {x 1, x 2,, x N } with a known probability P(x i ) = p i, i=1,2,,n Example 1: X = ( x 1 = lie on bed at 12 noon today x 2 = in university at 12 noon today x 3 = attend a lecture at 12 noon today ) = (B, U, L) p = (1/2,1/4,1/4), H(X) =.5*1+2*1/4+2*1/4=1.5 (Entropy) B=0, U=1, L=01 (coding) L s =0.5*1+0.25*1+0.25*2=1.25 (average coding length)

Information sources Example 2. Left: information source p(x i ), i = 1,.,27 right: codes To be, or not to be, that is the question Whether 'tis Nobler in the mind to suffer The Slings and Arrows of outrageous Fortune, Or to take Arms against a Sea of troubles, And by opposing end them? To die, to sleep As short as possible 01110 00001111111 1111110000000000 1111000000011000 100010000010000 1011111111100000

Information source coding Replacement of the symbols (naked run/office in PM example) with a binary representation is termed source coding. In any coding operation we replace the symbol with a codeword. The purpose of source coding is to reduce the number of bits required to convey the information provided by the information source: minimize the average length of codes. Conjecture: an information source of entropy H needs on average only H binary bits to represent each symbol.

Shannon's first theorem An instantaneous code can be found that encodes a source of entropy H(X) with an average number L s (average length) such that L s >= H(X)

How does it work? Like many theorems of information theory, the theorem tells us nothing of how to find the code. However, it is useful results. Let us have a look how it works

Example Look at the activities of PM in three days with P(O)=0.9 Calculate probability Assign binary codewords to these grouped outcomes. code length

Example Table 1 shows such a code, and the probability of each code word occurring. Entropy is H(X) = -0.729log 2 (0.729)-0.081log 2 (0.081)*3-0.009*log 2 (0.009)*3-0.001*log 2 (0.001) = 1.4070 The average length of coding is given by L s = 0.729*1+0.081*1+2*0.081*2+2*0.009*2 +3*0.009+3*0.001 = 1.2

Example Moreover, without difficulty, we have found a code that has an average bit usage less than the source entropy.

Example However, there is a difficulty with the code in Table 1. Before a code word can be decoded, it must be parsed. Parsing describes that activity of breaking the message string into its component codewords.

Example After parsing, each codeword can be decoded into its symbol sequence. An instantaneously parsable code is one that can be parsed as soon as the last bit of a codeword is received.

Instantaneous code An instantaneous code must satisfy the prefix condition: that no codeword may be a prefix of any other code. For example: in the codeword, we should not use 1 11 to code two events When we receive 11, it could be ambiguous This condition is not satisfied by the code in Table 1.

Huffman coding The code in Table 2, however, is an instantaneously parsable code. It satisfies the prefix condition.

Huffman coding code length L s = 0.729*1+0.081*3*3+0.009*5*3+0.001* 5 = 1.5980 (remember entropy is 1.4)

Huffman coding Decoding 1 1 1 0 1 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 1

Huffman coding The derivation of the Huffman code tree is shown in the following Figure and the tree itself is shown in the next Figure In both these figures, the letter A to H have be used in replace of the sequence in Table 2 to make them easier to read.

Huffman coding

Huffman coding Prefix condition is obviously satisfied since in the tree above, each branch codes one alphabetic.

Huffman coding For example, the code in Table 2 uses 1.6 bits/symbol which is only 0.2 bits/symbol more bits per sequence than the theorem tells us is the best we can do. We might conclude that there is little point in expending the effort in finding a code less satisfying the inequality above.

Another thought How much have we saved in comparison with the most naïve idea? i.e. O=1, N=0 L s =3 [ P(OOO)+ +P(NNN)] = 3, halving it

My most favourite story (History) In 1951,David A Huffman 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 when he hit upon the idea of using a frequency-sorted binary tree and quickly proved this method the most efficient. In doing so, the student outdid his professor, who had worked with information theory inventor Clude Shannon to develop an optimal code. By building the tree from the bottom up instead of the top down, Huffman avoided the major flaw of the suboptimal Shannon-Fano coding.

Coding English: Huffman Coding Frequency for alphabetics

Turbo coding Using Bayesian theorem to code and decode Bayesian theorem basically said we should employ priori knowledge as much as possible Read yourself