EEE377 Lecture Notes1 EEE436 DIGITAL COMMUNICATION Coding En. Mohd Nazri Mahmud MPhil (Cambridge, UK) BEng (Essex, UK) Room 2.14.

Slides:



Advertisements
Similar presentations
Noise, Information Theory, and Entropy (cont.) CS414 – Spring 2007 By Karrie Karahalios, Roger Cheng, Brian Bailey.
Advertisements

Lecture 4 (week 2) Source Coding and Compression
Sampling and Pulse Code Modulation
Michael Alves, Patrick Dugan, Robert Daniels, Carlos Vicuna
Greedy Algorithms Amihood Amir Bar-Ilan University.
Arithmetic Coding. Gabriele Monfardini - Corso di Basi di Dati Multimediali a.a How we can do better than Huffman? - I As we have seen, the.
Information Theory EE322 Al-Sanie.
Bounds on Code Length Theorem: Let l ∗ 1, l ∗ 2,..., l ∗ m be optimal codeword lengths for a source distribution p and a D-ary alphabet, and let L ∗ be.
SIMS-201 Compressing Information. 2  Overview Chapter 7: Compression Introduction Entropy Huffman coding Universal coding.
Huffman Encoding Dr. Bernard Chen Ph.D. University of Central Arkansas.
Data Compressor---Huffman Encoding and Decoding. Huffman Encoding Compression Typically, in files and messages, Each character requires 1 byte or 8 bits.
Chapter 6 Information Theory
Data Compression Michael J. Watts
Lecture04 Data Compression.
1 Huffman Codes. 2 Introduction Huffman codes are a very effective technique for compressing data; savings of 20% to 90% are typical, depending on the.
EEE377 Lecture Notes1 EEE436 DIGITAL COMMUNICATION Coding En. Mohd Nazri Mahmud MPhil (Cambridge, UK) BEng (Essex, UK) Room 2.14.
Semester Copyright USM EEE442 Computer Networks The Data Link / Network Layer Functions: Switching En. Mohd Nazri Mahmud MPhil (Cambridge, UK)
Fundamental limits in Information Theory Chapter 10 :
Spatial and Temporal Data Mining
DIGITAL COMMUNICATION Coding
A Data Compression Algorithm: Huffman Compression
Is ASCII the only way? For computers to do anything (besides sit on a desk and collect dust) they need two things: 1. PROGRAMS 2. DATA A program is a.
EEE377 Lecture Notes1 EEE436 DIGITAL COMMUNICATION Coding En. Mohd Nazri Mahmud MPhil (Cambridge, UK) BEng (Essex, UK) Room 2.14.
Information Theory Eighteenth Meeting. A Communication Model Messages are produced by a source transmitted over a channel to the destination. encoded.
Data Structures – LECTURE 10 Huffman coding
EE436 Lecture Notes1 EEE436 DIGITAL COMMUNICATION Coding En. Mohd Nazri Mahmud MPhil (Cambridge, UK) BEng (Essex, UK) Room 2.14.
EEE377 Lecture Notes1 EEE436 DIGITAL COMMUNICATION Coding En. Mohd Nazri Mahmud MPhil (Cambridge, UK) BEng (Essex, UK) Room 2.14.
Variable-Length Codes: Huffman Codes
Fundamentals of Multimedia Chapter 7 Lossless Compression Algorithms Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
DIGITAL COMMUNICATION Coding
Source Coding Hafiz Malik Dept. of Electrical & Computer Engineering The University of Michigan-Dearborn
Information Theory and Security
Data Compression Basics & Huffman Coding
Management Information Systems Lection 06 Archiving information CLARK UNIVERSITY College of Professional and Continuing Education (COPACE)
Huffman Codes Message consisting of five characters: a, b, c, d,e
Data Structures and Algorithms Huffman compression: An Application of Binary Trees and Priority Queues.
Information Theory & Coding…
Lecture 1 Contemporary issues in IT Lecture 1 Monday Lecture 10:00 – 12:00, Room 3.27 Lab 13:00 – 15:00, Lab 6.12 and 6.20 Lecturer: Dr Abir Hussain Room.
Noiseless Coding. Introduction Noiseless Coding Compression without distortion Basic Concept Symbols with lower probabilities are represented by the binary.
exercise in the previous class
Basic Concepts of Encoding Codes, their efficiency and redundancy 1.
Communication Technology in a Changing World Week 2.
Image Compression (Chapter 8) CSC 446 Lecturer: Nada ALZaben.
Compression.  Compression ratio: how much is the size reduced?  Symmetric/asymmetric: time difference to compress, decompress?  Lossless; lossy: any.
DCSP-8: Minimal length coding I Jianfeng Feng Department of Computer Science Warwick Univ., UK
COMPRESSION. Compression in General: Why Compress? So Many Bits, So Little Time (Space) CD audio rate: 2 * 2 * 8 * = 1,411,200 bps CD audio storage:
Introduction to Algorithms Chapter 16: Greedy Algorithms.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 8. Greedy Algorithms.
Huffman coding Content 1 Encoding and decoding messages Fixed-length coding Variable-length coding 2 Huffman coding.
DIGITAL COMMUNICATIONS Linear Block Codes
Foundation of Computing Systems
1 Data Compression Hae-sun Jung CS146 Dr. Sin-Min Lee Spring 2004.
Huffman Coding (2 nd Method). Huffman coding (2 nd Method)  The Huffman code is a source code. Here word length of the code word approaches the fundamental.
Lampel ZIV (LZ) code The Lempel-Ziv algorithm is a variable-to-fixed length code Basically, there are two versions of the algorithm LZ77 and LZ78 are the.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 18.
UNIT I. Entropy and Uncertainty Entropy is the irreducible complexity below which a signal cannot be compressed. Entropy is the irreducible complexity.
UNIT –V INFORMATION THEORY EC6402 : Communication TheoryIV Semester - ECE Prepared by: S.P.SIVAGNANA SUBRAMANIAN, Assistant Professor, Dept. of ECE, Sri.
Data Compression Michael J. Watts
Huffman Codes ASCII is a fixed length 7 bit code that uses the same number of bits to define each character regardless of how frequently it occurs. Huffman.
HUFFMAN CODES.
EE465: Introduction to Digital Image Processing
Chapter 9: Huffman Codes
Huffman Coding CSE 373 Data Structures.
DIGITAL COMMUNICATION Coding
Algorithms CSCI 235, Spring 2019 Lecture 31 Huffman Codes
Analysis of Algorithms CS 477/677
Lecture 8 Huffman Encoding (Section 2.2)
Presentation transcript:

EEE377 Lecture Notes1 EEE436 DIGITAL COMMUNICATION Coding En. Mohd Nazri Mahmud MPhil (Cambridge, UK) BEng (Essex, UK) Room 2.14

EEE377 Lecture Notes2 Source Coding Source encoding is the efficient representation of data generated by a source. For an efficient source encoding, knowledge of the statistics of the source is required. If some source symbols are more probable than others, we can assign short code words to frequent symbols and long code words to rare source symbols.

EEE377 Lecture Notes3 Source Coding Consider a discrete source whose output of k different symbols s k is converted by the source encoder into a block of 0s and 1s denoted by b k Assume that the kth symbol, s k occurs with probability p k, k=0,1…..K-1. Let the binary code word assigned to symbol s k have length l k (in bits) Therefore the average code-word length of the source encoder is given by

EEE377 Lecture Notes4 Source Coding Let L min denotes the minimum possible value of code-word length The Coding efficiency of the source encoder is given by

EEE377 Lecture Notes5 Data Compaction Data compaction is important because signals generated contain a significant amount of redundant info and waste communication resources during transmission. For efficient transmission, the redundant info should be removed prior to transmission. Data compaction is achieved by assigning short description to the most frequent outcomes of the source output and longer description to the less frequent ones. Some source-coding schemes for data compaction:- Prefix coding The Huffman Coding The Lempel-Ziv Coding

EEE377 Lecture Notes6 Prefix Coding A prefix code is a code in which no code word is the prefix of any other code word Example: Consider the three source codes described below Source Symbol Probability of Occurrence Code ICode IICode III s0s s1s s2s s3s

EEE377 Lecture Notes7 Prefix Coding Source Symbol Probability of Occurrence Code ICode IICode III s0s s1s s2s s3s Is Code I a prefix code? It is NOT a prefix code since the bit 0, the code word for s 0, is a prefix of 00, the code word for s 2 and the bit 1, the code word for s 1, is a prefix of 11, the code word for s 3. Is Code II a prefix code? Yes Is Code III a prefix code? No A prefix code has the important property that it is always uniquely decodable

EEE377 Lecture Notes8 Prefix Coding - Example Source Symbol Code I Code IICode IIICode IV s0s s1s s2s s3s s4s Prefix code? xx

EEE377 Lecture Notes9 Huffman Coding – a type of prefix code Basic idea : Assign to each symbol a sequence of bits roughly equal in length to the amount of information conveyed by the symbol. Huffman encoding algorithm: Step 1: The source symbols are listed in order of decreasing probability. The two source symbols of lowest probability are assigned a 0 and 1. Step 2: These two source symbols are regarded as being combined into a new source symbol with probability equal to the sum of the two original probabilities. The probability of the new symbol is placed in the list in accordance with its value. The procedure is repeated until we are left with a final list of symbols of only two for which a 0 and 1 are assigned. The code for each source symbol is found by working backward and tracing the sequence of 0s and 1s assigned to that symbol as well as its successors.

EEE377 Lecture Notes10 Huffman Coding – Example Step 1: The source symbols are listed in order of decreasing probability. The two source symbols of lowest probability are assigned a 0 and 1. Step 2: These two source symbols are regarded as being combined into a new source symbol with probability equal to the sum of the two original probabilities. The probability of the new symbol is placed in the list in accordance with its value. The procedure is repeated until we are left with a final list of symbols of only two for which a 0 and 1 are assigned. The code for each source symbol is found by working backward and tracing the sequence of 0s and 1s assigned to that symbol as well as its successors.

EEE377 Lecture Notes11 Huffman Coding – Average Code Length = 0.4(2) + 0.2(2) + 0.2(2) + 0.1(3) + 0.1(3) = 2.2

EEE377 Lecture Notes12 Huffman Coding – Exercise SymbolS0S0 S1S1 S2S2 Probability Compute the Huffman code. What is the average code-word length?

EEE377 Lecture Notes13 Huffman Coding – Exercise

EEE377 Lecture Notes14 Huffman Coding – Two variations When the probability of the combined symbol is found to equal another probability in the list, we may proceed by placing the probability of the new symbol as high as possible or as low as possible.

EEE377 Lecture Notes15 Huffman Coding – Two variations

EEE377 Lecture Notes16 Huffman Coding – Two variations

EEE377 Lecture Notes17 Huffman Coding – Two variations Which one to choose?

EEE377 Lecture Notes18 Huffman Coding – Exercise SymbolS0S0 S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 Probability Compute the Huffman code by placing the probability of the combined symbol as high as possible. What is the average code-word length?

EEE377 Lecture Notes19 Huffman Coding – Exercise Answer SymbolS0S0 S1S1 S2S2 S3S3 S4S4 S5S5 S6S6 Probability

EEE377 Lecture Notes20 Huffman Coding – Exercise

EEE377 Lecture Notes21 Huffman Coding – extended form The source is then extended to order two.

EEE377 Lecture Notes22 Huffman Coding – extended form

EEE377 Lecture Notes23 Lempel-Ziv Coding – a type of prefix code Basic idea : Parse the source data stream into segments that are the shortest subsequences not encountered previously Consider an input binary sequence … Assume that the binary symbols 0 and 1 are already stored Subsequences stored0,1 Data to be parsed … With symbols 0 and 1 already stored, the shortest subsequence encountered for the first time is 00, so Subsequences stored0,1,00 Data to be parsed … The second shortest subsequence not seen before is 01,so Subsequences stored0,1,00,01 Data to be parsed …

EEE377 Lecture Notes24 Lempel-Ziv Coding – a type of prefix code The next shortest subsequence not seen before is 011,so Subsequences stored0,1,00,01,011 Data to be parsed … Continue until the given data stream has been completely parsed Numerical Positions: Subsequences: Numerical representations: Binary encoded blocks:

EEE377 Lecture Notes25 Lempel-Ziv Coding – Exercise Encode the following sequence using Lempel-Ziv algorithm assuming that 0 and 1 are already stored ….

EEE377 Lecture Notes26 Lempel-Ziv Coding – Exercise Answer Encode the following sequence using Lempel-Ziv algorithm assuming that 0 and 1 are already stored ….

EEE377 Lecture Notes27 Lempel-Ziv Coding – Exercise Answer Encode the following sequence using Lempel-Ziv algorithm assuming that 0 and 1 are already stored ….

EEE377 Lecture Notes28 Lempel-Ziv Coding – Exercise Answer Encode the following sequence using Lempel-Ziv algorithm assuming that 0 and 1 are already stored ….

EEE377 Lecture Notes29 Lempel-Ziv Coding – Exercise Answer Encode the following sequence using Lempel-Ziv algorithm assuming that 0 and 1 are already stored …. 1000,