Digital Class Homework
ENGR 0832: Digital World 2020 SPRING 2015
Final Exam
Due Date: 04/23/2015
Student Name: ____________________
Score: __________________
Directions: Submit your report in class on Thursday, April 23 rd
, 2015. No email or late submission
will be accepted. Show all your work. No plagiarism. Good luck!
1. (40 points) What is the definition of “Nyquist rate”? What is the “Nyquist sampling theorem”?
Plot the signal 𝑠(𝑡) = sin(4𝜋𝑡).
a. Assuming a sampling period 𝑇𝑠 = 0.3s, plot its samples. What has happened? Have you
sampled above the Nyquist rate?
b. Assuming a bit depth of 4 bits and a sampling rate 𝑓𝑠 = 24Hz, plot its samples and
convert the analog waveform defined by 𝑠(𝑡)into digital.
c. Convert the digital waveform back to analog using your results in (c). The reconstructed
waveform should look like a staircase.
2. (30 points) ASCII encodes English text by using 1 byte (including parity bit) per symbol. Take
any book that you have read recently and pick a page at random. Take any full line on that page
and count the number of symbols in the line of text. Do not forget to count spaces and
punctuation marks. Next, count the number of lines on the page. Now multiply the number of
symbols per line by the number of pages in the book. Make sure to justify your work, indicate the
total number of pages in the book you picked and include a hard copy of the page in your report.
a. About how many bytes would it take to store all of the characters and punctuation in this
book, using ASCII code as a formatting method?
b. A CD-ROM holds around 700 MB of information. How many similar books could be
stored on a CD-ROM using ASCII?
c. Using the same full line on that page, find the Huffman codebook and the number of
bytes needed to store one line of text. About how many bytes would it take to store all of
the characters and punctuation in this book, using Huffman as a formatting method?
Compute the compression ratio using your results in (a).
3. (30 points) An 8 × 8 pixel image is defined as follows. The four corner pixels all have a value of
15. The two central columns and the two central rows have a value of 15. All other pixels have a
value of 0.
a. Write this image as a grid of numbers and draw it. What is the total number of pixels in
the image? How many bits are needed to represent the gray values of the pixels? What is
the total number of bits needed to represent the image?
b. If we reduce the sampling rate for the image by a factor of two along rows and columns,
what will be the size of the new image? Write this image as a grid of numbers rounded to
the nearest integer. Draw the new image.
c. Many different 8 × 8 images will look the same as the result you found in (b) when the
sampling rate is reduced by a factor of two. Specify one of these 8 × 8 images that is as
different from the image specified in (a) as you can make it. Write your image as a grid
of numbers and draw it.