Design a shannon-fano code

Assignment Help Computer Engineering
Reference no: EM13801500

Question 1 (10 points) Consider a three-symbols alphabet with the specified probability of assignment shown below:

X,

P(X,)

a

0.70

b

0.25

c

0.05

Listed with the input alphabet are six binary code assignments.

Symbol

Code 1

Code 2

Code 3

Code 4

Code 5

Code 6

a

00

00

0

1

I

1

b

ll

01

1

10

01

00

c

11

10

11

100

11

01


(a) Scan these codes and determine which codes are practical (can be used for data compression application). Justify your answers.

(b) Design a Huffman code for the above three-symbols source alphabet shown above and find its code efficiency (i.e., compression efficiency).

(c) Design a Shannon-Fano code for the above three-symbol source alphabet shown above and find its code efficiency. Compare it with your answer in part (b).

(d) Can you suggest a technique to improve the code efficiency to achieve a greater compression ratio? Determine the code efficiency for your improved source coding method.

Question 2: Huffman Coding

In this problem, you will study the efficacy of Huffman source coding (data compression algorithm) on two different data sources. Generate two test data files data1.txt and data2.txt. Create the first test data file data1.txt such that it contains at least 20 characters (including spaces). Next create a second test data file data2.txt consisting of about 20 binary digits (i.e., digits 0 and 1).

(a) Suppose you wish to compress the data1.txt and data2.txt using Huffman source coding method. Find the compression efficiency and the average codeword length. Clearly show your final code design (i.e., codeword for each source symbol).

(b) Repeat part (a) but now consider at least 5000 characters and 5000 digits for data1.txt and data2.txt, respectively.

(c) Validate that your design and your program works fine (i.e., correct data encoding and decoding) for both of your test data files in parts (a) and (b). Compare your results with the compression efficiency attainable with "compress" routine in UNIX or with other data compression utilities (e.g., zip). Explain any interesting observations and/or trends from your results.

(d) Explain why Huffman coding is NOT used for data compression of practical data sources? In other words, why practical source compression utilities (e.g., zip, gnuzip, etc.) do not use Huffman coding method despite its optimality?

(e) Explain why it might be more advantageous to employ the Lempel-Ziv algorithm over Huffman coding method for digital multimedia (image/audio/video) data compression applications?

Reference no: EM13801500

Questions Cloud

What are the two major types of interest groups : What are the two major types of interest groups and examples of each. Which of these types of interest groups tend to be more powerful? Explain your choice.
Why is apa style used to document ideas in writing : Why is APA Style used to document ideas in writing? What is the purpose of the in-text citation? Demonstrate your understanding of the in-text citation by providing an in-text citation for the article you summarized.
How technology may contribute to child exploitation : How technology may contribute to child exploitation
Drawing on the review of organizational theory : What distinguishes a public organization from a private organization. Drawing on the review of organizational theory is there a particular theory that fits public and hybrid organizations better than others
Design a shannon-fano code : Design a Shannon-Fano code for the above three-symbol source alphabet shown above and find its code efficiency. Compare it with your answer in part (b)
What factors are most important as you become socialized : What factors are most important as you become socialized as a BSN student? What are your resources in this process? How can this process be most effective?
Plan for compliance with the sarbanes-oxley act : Develop a plan for compliance with the Sarbanes-Oxley Act (SOX) in a hospital setting. How can employees become knowledgeable with the major provisions of SOX?
Defense of the arts : Write a review of your arts experience that includes a defense of the arts. Include the following:
Individual assignment performing and visual arts paper : Individual Assignment Performing and Visual Arts Paper

Reviews

Write a Review

Computer Engineering Questions & Answers

  Design two concrete classes circle and square that inherits

design an abstract class called shape. this class must contain a single constructor that accepts a single numeric value

  Make a math tutor program in vb.net

make a math tutor program in VB.Net.

  What are the potential benefits to consumers

What are the implications for firms operating in effected industries? What are the potential benefits to consumers? Do consumers lose anything from this legislation? Include the urls of your sources

  The shipping clerk at the rinky dooflingy company is faced

Write a program that reads the number of dooflingies to be shipped and displays the number of huge, large, medium, and small containers needed to send the shipment in the atleast number of containers and with the minimum amount of wasted space.

  Algorithm for carrying out concatenation operation

Develop an algorithm that concatenates T1 and T2 into the single binary search tree. The worst case running time must be O(h), where h is the maximum of h1 and h2, the heights of T1 and T2.

  Questionyour company has a benchmark that is considered

questionyour company has a benchmark that is considered representative of your typical applications. an embedded

  Make an html page with a form for client

make a form using JavaScript that collects client body statistics and customer contact information for record keeping and marketing purposes.

  Draw the uml diagram for the class and then implement the

draw the uml diagram for the class and then implement the class. write a program that creates two rectangles objects

  Suggestions for ensuring an adequate change control

What are two suggestions for ensuring the adequate change control on projects that involve outside contracts.

  Create program that reads from the external file input.txt

create a program that reads from the external file input.txt

  Advantage and one disadvantage of virtual machine approach

Java and many other programming languages have taken approach of executing on a virtual machine, as opposed to compiling to native machine code.

  Express what makes one algorithm better than another

A non-technical friend has asked whether some algorithms are better than others. express what makes one algorithm better than another.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd