Assignment 2 - Sound (100 pts)

Due March 13, 11:59pm by email to

Part 1. Written problems (40 pts)

1. My old SoundBlaster card is an 8-bit card.
a.) (3 pts) What is it 8 bits of?
b.) (5 pts) What is the best SQNR it can achieve?

2. Suppose we have a signal whose maximum frequency is 44kHz and whos minimum frequency is 500 Hz.
a.) (3 pts) What is the minimum sampling rate that we could use for this signal?
b.) (5 pts) Say we encode the signal at 8 bits per sample and the signal is in stereo. What would the data rate be (in kB/sec)?

3. (8 pts) Suppose the sampling frequency is 1.5 times the frequency. What is the alias frequency?

4. (8 pts) Explain the difference between uniform and non-uniform quantization. Why might we want to use non-uniform quantization?

5. (8 pts) Our input signal has values: 21 25 26 32 21 25 27 24 22 22 22 22. Suppose we use a predictor as follows (assume we always round down when predicting):

What values would we *transmit* using lossless predictive coding?

Part 2. Creating and manipulating sound waves (60 pts)

Compose a piece of music using matlab. Your piece should include musical notes (10 pts), mixtures of musical notes (ie chords - 10 pts), imported samples of audio files (10 pts), filtering (10 pts) and visualizations of your piece (5 pts). You will also receive points for flair and creativity (15 pts). The file notes.m contains frequencies for musical notes and will be helpful when composing your song. The sound lab exercises and this file freqplay.m give simple examples of how to implement each of these compositional features.

What to turn in:

Email me ( the answers to the written problems in a pdf document. Also email your matlab script (composition.m) implementing your composition, and a wavfile (composition.wav) containing your final composition. You can use the wavwrite command to save a wave file, for example, wavwrite(composition,Fs,16,'composition.wav');. We will have a contest with prizes for the best final composition.

Extra Credit

Translate a simple song from musical notes into sound signals in matlab. Turn in your code (extracredit.m) and song (extracredit.wav). Note you may not use the same composition for the main HW and extra credit.