Problem Set 4 on Digital Image Processing | ECE 6258, Assignments of Digital Signal Processing

Material Type: Assignment; Class: Digital Image Processing; Subject: Electrical & Computer Engr; University: Georgia Institute of Technology-Main Campus; Term: Fall 2003;

Typology: Assignments

Pre 2010

Uploaded on 08/05/2009

koofers-user-2u8
koofers-user-2u8 šŸ‡ŗšŸ‡ø

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
GEORGIA INSTITUTE OF TECHNOLOGY
School of Electrical and Computer Engineering
ECE 6258
Digital Image Processing
Fall 2003
Problem Set #4
Issued: Wednesday, October 1, 2003
Due (live): Friday, October 10, 2003
Due (video): Friday, October 24, 2003
Problem 4.1 (Huffman Codes): Find a Huffman code for the source shown below. The
resulting codes are not unique, but you should try to find a code whose longest code-
word is as short as possible.
Si:p(Si)
S1:0.20
S2:0.18
S3:0.12
S4:0.10
S5:0.10
S6:0.08
S7:0.06
S8:0.06
S9:0.06
S10:0.04
Problem 4.2 (Tunstall Codes): A Huffman code accepts strings of symbols of equal
length and maps them to codewords of variable length. A run-length code, by way of
contrast, accepts input strings of variable length and outputs symbols of equal length.
The optimal code of the latter type is known as a Tunstall code. Tunstall codes are
duals of Huffman codes. A Q-ary Tunstall code operating on strings of binary input
symbols can be found by the following procedure:
1. First form a tree with two leaves.
2. Grow the tree by extending the most probable leaf.
3. Repeat Step 2 until the tree has Qleaves.
4. The path from the root to the leaf corresponds to the input sequence that is
mapped to the symbol attached to the leaf.
(a) Design a Tunstall code for encoding the output of a zero-memory source S={0,1}
with p(0) = 0.75, p(1) = 0.25. The number of symbols to be encoded in Q=8.
Each symbol will be represented by a three-bit number.
(b) Compute the entropy of the source H(S).
(c) Compute the ratio of the average number of output bits per input bit.
(d) As an alternative, suppose a run-length code is used to encode the input strings
pf2

Partial preview of the text

Download Problem Set 4 on Digital Image Processing | ECE 6258 and more Assignments Digital Signal Processing in PDF only on Docsity!

GEORGIA INSTITUTE OF TECHNOLOGY

School of Electrical and Computer Engineering

ECE 6258 Digital Image Processing Fall 2003

Problem Set #

Issued: Wednesday, October 1, 2003 Due (live): Friday, October 10, 2003 Due (video): Friday, October 24, 2003

Problem 4.1 (Huffman Codes): Find a Huffman code for the source shown below. The resulting codes are not unique, but you should try to find a code whose longest code- word is as short as possible.

Si: p(Si) S 1 : 0. S 2 : 0. S 3 : 0. S 4 : 0. S 5 : 0. S 6 : 0. S 7 : 0. S 8 : 0. S 9 : 0. S 10 : 0.

Problem 4.2 (Tunstall Codes): A Huffman code accepts strings of symbols of equal length and maps them to codewords of variable length. A run-length code, by way of contrast, accepts input strings of variable length and outputs symbols of equal length. The optimal code of the latter type is known as a Tunstall code. Tunstall codes are duals of Huffman codes. A Q-ary Tunstall code operating on strings of binary input symbols can be found by the following procedure:

  1. First form a tree with two leaves.
  2. Grow the tree by extending the most probable leaf.
  3. Repeat Step 2 until the tree has Q leaves.
  4. The path from the root to the leaf corresponds to the input sequence that is mapped to the symbol attached to the leaf.

(a) Design a Tunstall code for encoding the output of a zero-memory source S = { 0 , 1 } with p(0) = 0.75, p(1) = 0.25. The number of symbols to be encoded in Q = 8. Each symbol will be represented by a three-bit number. (b) Compute the entropy of the source H(S). (c) Compute the ratio of the average number of output bits per input bit. (d) As an alternative, suppose a run-length code is used to encode the input strings

S 1 : 1

S 2 : 01

S 3 : 001

S 4 : 0001

S 5 : 00001

S 6 : 000001

S 7 : 0000001

S 8 : 0000000

and the results are then Huffman coded. What is the average number of output bits per input bit? (e) Can you improve on the performance of the Tunstall code by following it with a Huffman code as you did in part (d)?

Problem 4.3 (Arithmetic Coding): This problem is concerned with using an arithmetic coder to encode a Markov source. Consider the simple first-order Markov source defined by the following conditional probabilities:

p(0|0) = 0. 8 p(1|0) = 0. p(0|1) = 0. 4 p(1|1) = 0.

(a) What are the stationary probabilities, p(0) and p(1)? (b) Assuming that this information source is initially modeled as a zero-memory source with the stationary probabilities given in (a), determine the entropy of the source. (c) Encode the source sequence 0100101111000 using an arithmetic coder using the zero-memory source model. (d) What is the entropy of the source using the Markox model? (e) Assuming that the first bit of the sequence is sent unencoded, encode the remain- der of the sequence in part (c) using the Markov model. (f) Decode your sequence from part (e).

Problem 4.4 (Optimal Quantization): A sequence of independent Gaussian random variables has a mean of zero and a standard deviation of one. These random variables are to be quantized to five levels.

((a)) Design an optimal quantizer (that minimizes the mean-squared quantization error). Specify the thresholds and reproduction values of your quantizer. Your solution may be analytical or numerical, although the latter is recommended. (b) Compute the entropy of a sequence of quantized samples. (c) Compute the mean-squared error associated with your quantizer. (d) Now design an optimal vector quantizer, with a codebook of length 25 that quantizes a pair or consecutive samples. Recommended approach: Start with a separable version of your quantizer from part (a). Using a test sequence of say 1000 samples, improve your quantizer if possible using several Lloyd iterations. (e) What is the entropy per sample of your codebook? (f) What is the mean-squared error per sample?