EE 4830 Spring 2007

Problem Set #7

Due Wednesday May 3rd 10:00am as hardcopy at Junfeng's mailbox #K4
optionally also submit electronic copy to both Lexing (lx21) and Junfeng (jh2700). Solutions will be out on Wednesday so no late HWs will be accepted.

Problems 1 is required, which you can either solve by hand or program matlab scripts to do it; Problem 2 is experimental and optional (bonus).

1)  Source codes for letters in English
1.1) (5pts) Compute the entropy of the source letters with the following probability. 
Letter a b c e g i l m o r s t u
Probability 0.1000 0.0500 0.0500 0.1500 0.0500 0.1000 0.0500 0.0500 0.0800 0.0800 0.0800 0.0800 0.0800

1.2) (5 pts) Construct a binary Huffman code for these symbols.
1.3) (5 pts) Construct a ternary Huffman code (i.e. the output codes are strings of symbols "0", "1" and "2").
1.4) (5 pts) The arithmatic code for a five-letter word is 0.45518. Decode this word.

2) Comparing image compression systems (optional, 20 pts bonus).
Use JPEG and JPEG2000 to compress the following two raw images peppers.ppm and baboon.ppm at a few different rates (from 0.1 bit-per-pixel/bpp to lossless). for JPEG encoder you can just use matlab: imwrite(A, 'outputfile.jpg', 'Quality', q) performs compression with quality factor q. For JPEG200 you can use the Java implementations "jj2000 v5.1" at http://jpeg2000.epfl.ch/: you can compress the image into j2k stream and then decompress it back to ppm,  then use matlab to calculate PSNR on the images.
2.1) (10 pts) Plot the Rate vs. PSNR curve and comment on the differences between coding systems and across different images.
2.2) (5 pts) Based on the rate-distortion curve, which system would you use if we want to implement the compression module in a digital camera for high quality image (4bpp) ?
2.3) (5 pts) At low bit-rates (<0.5 bpp) Does compressed images with higher PSNR always look better visually? Why?

Note: since this problem is optional, you will be responsible for figuring out how to run jj2000 and setting up your java environment (if you haven't), we will provide help and answer questions but will not be coaching and helping to trouble shoot you OS/environments.