1 / 7

COM342 Networks and Data Communications

COM342 Networks and Data Communications. Lecture 4B: Further examples of Huffman codes (Data Compression). Ian McCrum Room 5B18 Tel: 90 366364 voice mail on 6 th ring Email: IJ.McCrum@Ulster.ac.uk Web site: http://www.eej.ulst.ac.uk. 1. 0. A. 0. 1. C. B. Decoding Huffman codes.

aline-walsh
Télécharger la présentation

COM342 Networks and Data Communications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COM342Networks and Data Communications Lecture 4B: Further examples of Huffman codes (Data Compression) Ian McCrum Room 5B18 Tel: 90 366364 voice mail on 6th ring Email: IJ.McCrum@Ulster.ac.uk Web site: http://www.eej.ulst.ac.uk http://www.eej.ulst.ac.uk/~ian/modules/COM342

  2. 1 0 A 0 1 C B Decoding Huffman codes Given the Huffman Tree on the left decode the pattern 0011100 0 0 11 10 0 A A B C A http://www.eej.ulst.ac.uk/~ian/modules/COM342

  3. Another example of generating Huffman trees and codes e.g Consider just the six letters below and their frequencies in a large message, placed in ascending order! E 0.1250 T 0.0925 A 0.0805 O 0.0760 I 0.0729 N 0.0710 We are going to pick the least two frequent and add their probabilities together, then remove the two and insert the new combined probability up the list, the list is now shorter. We repeat for the next two least frequent and the list gets shorter again. Until we have a single total. http://www.eej.ulst.ac.uk/~ian/modules/COM342

  4. 0 E= .1250 .2175 T= .0925 0 1 .5179 A= .0805 0 .1565 0 1 O= .0760 1 .3004 0 I= .0729 1 .1439 N= .0710 1 Hence A=100, E=00, I=110, N=111, O=101 and T=01 http://www.eej.ulst.ac.uk/~ian/modules/COM342

  5. E 0 0 T 1 A 0 1 O 0 1 I 0 1 N 1 Given the tree code …EATANIT Given A=100, E=00, I=110, N=111, O=101 and T=01 00 100 01 100 111 110 01 we would need a 3 bit code if size was fixed. Here we managed to send 18 bits instead of 21 bits so we get a 16% saving in message length. http://www.eej.ulst.ac.uk/~ian/modules/COM342

  6. E 0 0 T 1 A 0 1 O 0 1 I 0 1 N 1 Given the tree decode 1001110100111111100 A N T E N N A http://www.eej.ulst.ac.uk/~ian/modules/COM342

  7. Tutorial Question • The five vowels have a frequency as follows (A=0.3, E=0.3, I=0.15, O=0.15 and U=0.1) • Derive a huffman code for these. • Code the sequence AEIOUIOU • Write down a binary pattern using your codes and decode it, NB only pick codes from your calculated set http://www.eej.ulst.ac.uk/~ian/modules/COM342

More Related