15.6 Questions for the reader

15.6 Questions for the reader#

Exercise 99

Information rates. Consider a \(3\)-minute song.

  1. How many bytes does it take as uncompressed CD-quality audio (\(44.1\) kHz, \(16\) bits, stereo)?

  2. How many bytes does it take as an MP3 at \(128\) kbps?

  3. What is the compression factor of the MP3, relative to CD quality?

Reveal solution
  1. \(31{,}752{,}000\) bytes (about \(31.8\) MB)

  2. \(2{,}880{,}000\) bytes (about \(2.9\) MB)

  3. About \(11\times\)

Exercise 100

Equal loudness. Use the equal-loudness contours from Equal-loudness contours, or the ISO 226 standard, for this question.

  1. A \(1000\) Hz tone plays at \(60\) dB SPL. What is its loudness in phons?

  2. A \(100\) Hz tone also plays at \(60\) dB SPL. Does it sound louder or quieter than the \(1000\) Hz tone?

  3. At about what level must the \(100\) Hz tone play to sound as loud as the \(1000\) Hz tone?

Reveal solution
  1. \(60\) phons

  2. Quieter

  3. About \(79\) dB SPL

Exercise 101

Just intervals. Two sine tones play at \(300\) Hz and \(450\) Hz.

  1. What is their interval, as a ratio in lowest terms?

  2. How often (in Hz) does the sum of the two tones repeat?

  3. How many steps of 12-EDO are closest to this interval? What is the relative difference between the 12-EDO interval and the just interval?

Reveal solution
  1. \(3{:}2\)

  2. \(150\) Hz

  3. \(7\) steps, \(2^{7/12} \approx 1.498\), a relative difference of about \(-0.11\%\)

Exercise 102

Beyond 12 steps. In 19-EDO tuning, each step multiplies frequency by \(2^{\frac{1}{19}}\).

  1. By what factor does one step of 19-EDO multiply frequency?

  2. How many steps of 19-EDO are closest to the just major third (\(5{:}4\))? What is the relative difference?

  3. Is this closer or farther than the nearest step of 12-EDO?

Reveal solution
  1. About \(1.037\)

  2. \(6\) steps, \(2^{6/19} \approx 1.245\), a relative difference of about \(-0.42\%\)

  3. Closer (12-EDO is about \(+0.79\%\) away)

Exercise 103

Entropy and Huffman coding. A random variable has four outcomes, A, B, C, and D, with probabilities \(\frac{1}{2}\), \(\frac{1}{4}\), \(\frac{1}{8}\), and \(\frac{1}{8}\).

  1. What is its entropy, in bits?

  2. Construct a Huffman code for it.

  3. What is the expected length of your code, in bits per outcome?

Reveal solution
  1. \(1.75\) bits

  2. For example, A → \(\texttt{0}\), B → \(\texttt{10}\), C → \(\texttt{110}\), D → \(\texttt{111}\) (any code with lengths \(1\), \(2\), \(3\), \(3\))

  3. \(1.75\) bits, exactly the entropy

Exercise 104

Decoding Huffman codes. Using the code from this chapter’s example, TT → \(\texttt{0}\), TH → \(\texttt{11}\), HT → \(\texttt{100}\), and HH → \(\texttt{101}\), decode the bit string \(\texttt{1010110}\).

Reveal solution

HH TT TH TT

Exercise 105

Rice coding. Using the zigzag encoding and Rice coding with \(k = 2\), encode the residual values \(-3\) and \(20\). How many bits does each take?

Reveal solution

\(-3 \to \texttt{1001}\) (\(4\) bits), and \(20 \to \texttt{1111111111000}\) (\(13\) bits)

Exercise 106

MIDI messages.

  1. Write the three bytes (as bit strings) of a Note On message on channel \(1\) for E4 (MIDI pitch \(64\)) with velocity \(80\).

  2. Write the status byte (as a bit string) of a Note Off message on channel \(10\).

  3. How many bytes of Note On and Note Off messages does a melody of \(100\) notes take?

Reveal solution
  1. \(\texttt{10010000}\) \(\texttt{01000000}\) \(\texttt{01010000}\)

  2. \(\texttt{10001001}\)

  3. \(600\) bytes