Assignment 4
Due Monday, March 30 in class.
Show your work. Have fun.
1) More on filters, the "DC Blocker" (10 points)
The code removedc.c implements a filter with the following
difference equation:
y(n) = x(n)  x(n1) + 0.99y(n1)
this is implemented in code as:
lastOut = (0.99*lastOut) + ((float) data  lastIn);
a) (4 pts) Discuss and show in both the time and frequency domains
(using frequency analysis tools such as the Z transform, and
timebased signal analysis) how this filter removes the mean
of a signal, but allows most everything else to pass through.
b) (4 pts) Funny things show up in digital systems at 1/2 the
sampling rate. These can include errors introduced by single
sample delays, "limit cycles" due to computational rounding/
truncation, and other pathologies. If we wanted to modify
the DC blocking filter to remove only frequencies around
1/2 SRATE, rather than removing the zerofrequency mean,
how might we do that easily? Show this in the frequency
domain using the magnitude of the Z transform.
c) (2 pts) What if we wanted to remove frequencies at 1/4 the SRATE?
(note: this is very different from, and harder than a) and b).
2) Spectral Modeling, Vocoders/EQs Divide and Conquer (12 points, 2 pts each.)
Some Channel Vocoders divide the audible spectrum into 10 equal
octave (an octave is a doubling of frequency) bands.
a) If we assume that we can hear from 20 Hz. to 20 KHz. derive a
logarithmic division of this range into 10 octave bands, and
write out the "crossover" frequencies bounding each band.
b) Our auditory system has a critical bandwidth of roughly 1/3 octave
bands. Divide up the audible range into 30 bands and write out the
frequencies of those bands.
c) Some companies that make graphic equalizers "split the difference"
between 10 and 30 bands, and make 15 band equalizers. Start at a
lower frequency of 25 Hz, and write out the frequencies for a 15
logarithmic band EQ.
d) For various engineering reasons, highpower sound systems split up
the frequency spectrum and send them through separate amplifiers
to individual drivers optimized for these frequency ranges. Bi
amplification, triamping, and even quadramped systems are common
in rock music sound systems, and high end "audiophile" home
systems. Assume an even division of the audible range between
20 and 20,000 Hz. into four bands, and derive and write out the
frequency ranges of those bands.
e) Find a graphic EQ of some type (yours, or a friend's stereo,
car amps sometimes have 7 or so band EQ systems), or find one
on the web where you can identify the frequency regions. Report
them here and compare them to your results from above.
f) Find out the frequency range for the subwoofer channel of the
5.1 home theater system standard. Does this make sense given
your answer from d) above?
3) Some on musical tuning, scales, etc. (12 points)
The musical interval of the octave is a doubling of frequency,
so going from middle C on the piano (also called C4), with a
frequency of about 256 Hz., to the octave (C5) above, takes us
to 512 Hz. One common standard tone is A440, which is A4 above
middle C, with a frequency of 440 Hz.
a) (3 points) What's the frequency of A5? A3? C1? C8?
Find the biggest piano you can, and report here the brand name,
location of the piano, and how many octaves it ranges over.
Find a smaller electronic keyboard in your or your friend's
room, and report the brand and how many octaves it ranges over.
"Equal temperament" splits the octave into 12 even logarithmic
divisions, so that each musical semitone (space between any two
adjacent keys on the piano) is a distance (multiple in frequency)
of 2^{1/12}. 12 of those steps yields a multiplication
by 2^{12/12} = 2.0, or an octave. Pythagoras and many
others experimented with tuning and musical intervals long before
we had logs and MATLAB to help us. Pythagoras thought that all of
the important musical intervals could be expressed as simple integer
relationships between the frequencies. He derived these from simple
geometric relationships, such as cutting a string in half making
it sound one octave higher. Cutting a string to 2/3 length made
it sound one musical fifth higher (7 semitones, frequency ratio
of 3/2, distance between C and G, or F and C, A and E, etc.). A
school of musical "consonance" and "dissonance" grew, holding that
the simpler the integers in the ratio, the more "pleasant" the sound
of that interval (in order: 2/1, 1/2, 2/3, 3/2, 3/4, 4/3, etc.)
But there's a rub here when we compare with equal temperament:
b) (2 pts) How does the equally tempered interval of a fifth
(7 semitones, 2^{7/12} differ from 3/2?
c) (2 pts) What ratio of small integers comes closest to the
equally tempered interval of a fourth (5 semitones)? How do
they differ?
d) (2 pts) What ratio of small integers comes closest to the
equally tempered interval of a major third (4 semitones)?
How do they differ?
Small (sub semitone) musical distances are sometimes expressed
as quarter tones (log half of a semitone), eighth tones, or for
most precision, "cents." A musical cent is 1/100th of a semitone,
or a frequency ratio of 2^{1/1200}, so that 1200 cents
makes up an octave.
e) (3 pts) Go back and express the disparities of frequency in
cents, for the Fifth, Fourth, and Major Third from b) c) and d).
/***********************************************************************/
4) Do a 24.0 second musical statement using vocod.c, pv.c, warpfft.c,
Matlab Vocoder, or ChucK fft warpers/vocoders. For vocoding, use
two original soundfiles, one speech, one spectrally rich but nonspeech.
For the phasevocoders, use only one original soundfile. The cross
synthesis vocoding/shifting/morphing aspect should be evident, but
you may also dress up the result artistically by placing it in a more
musical setting by adding accompaniment, a base of convolved sound, a
drum beat, whatever. Drop it in the usual place before class time on 3/30.
