Assignment 5

The assignment is due Wednesday, April 16, 2.59 pm EDT (before class), to be submitted via CourseWorks.

Some of the questions below are research questions, where you are asked to find information about a particular issue. You may use the Engineering Library, any text books you have, one of the paper from the class readings, or the web to come up with answers. Be sure to cite your sources. Generally, a paragraph or two should be sufficient to answer the question. There is no need to write a tutorial.

  1. Compute the Fourier coefficients of a square wave. Plot the resulting coefficient; it is sufficient to show the first ten coefficients.
  2. Using the slides, compute the DFT coefficients for the example given, f(x) = 2 sin(x) + sin(3x).
  3. Using the common Lena test image, compare compression ratios for JPEG, GIF and PNG. For JPEG, adjust the compression ratio. You may find the ImageMagick "convert" function useful. For JPEG, compare the signal-to-noise ratio for different quality metrics by computing the squared-pixel-difference. For computing these differences, consider using a pixel format such as PPM.
  4. Similarly, using the New York Times banner, compare the compression ratios for JPEG, GIF and PNG. As a baseline, since this is a grayscale image, assume eight bits per pixel.
  5. Huffman coding: Using the US Declaration of Independence, compute the letter frequencies, ignoring the difference between upper-case and lower-case letters, but preserving punctuation and spaces. (a) Construct a Huffman code for this set of letters. (b) Using the same all-lower-case text, compress it using gzip or zip. Compare the compression ratios.
  6. Video: This part adds video to your audio program you wrote earlier, making it truly multimedia. Just like for audio, you capture media, encode it, frame the media into packets and then send them to the receiver. The receiver reverses the process and renders the image on the screen.

    To capture video, you can use DirectX for Windows or V4L for Linux and a USB camera or a TV card with a framegrabber, if your PC has one (e.g., ATI All-in-Wonder). Windows, just about any USB camera should work, but as usual, Linux will require more investigation. Convert each image from the camera to JPEG ("motion JPEG"), using a library routine such as cJPEG, and render the image at the receiving end, after transporting it in UDP packets.

    If using C/C++, you may consider the Gtk library for creating simple GUI applications on both Linux and Windows.