EMS 2008 – Homework #3

EMS 2008 – Homework #3

ECE4893A: Electronics for Music Synthesis

Spring 2008

Homework #3

Due: Thursday, March 13 at the start of class

Ground rules: You are free to discuss approaches to
the problems with your fellow students, and talk
over issues when looking at schematics,
but your solutions should be your own. In particular, you should never
be looking
at another student’s solutions at the moment
you are putting pen to paper on your
own solution. That’s called “copying,” and it is lame. Unpleasantness
may result from such behavior.

Late policy: If
you show up really late, suggesting that you were doing the
homework during class,
then I’ll take off up to 10 points based on my mood.
If you turn it in later that day, say before 6:00 PM
or so (that’s when my 2025 recitation ends –
you can find me in Van Leer 361 from 3 to 6).
After that, I’ll take off 20 per day.
This isn’t to be mean – it’s
to encourage you to get it turned in and
get on with whatever other work you have to
do in other classes, even if it’s not
perfect – but also to encourage you to
go ahead and do the work and turn it in
and learn some stuff and get some points, even if you’re past the deadline.

Problem 1

using Chebychev Polynomials
, by Miller Puckette,
to review the material needed to do this problem.

According to some slides from ECE2025, you can synthesize a rough
periodic vowel sound by setting the 2nd, 4th, 5th
harmonics of a wave equal to 12, 29, and 49. We will let the remaining
harmonics be zero. (Notice the fundamental and
third harmonics are missing).

(a) Find a fifth order polynomial, represented as a function of f, f(x), such
that f(cos(omega t)) has the spectrum described above, with fundamental
frequency omega. (I would recommend using the provided functions
chebpolycoefs.m and
chebpolysum.m. Include a plot of your
polynomial f(x) over the range -1 to 1.

(b) Synthesize a tone f(a(t) cos(omega t)), where a(t) is a decaying function
of time that starts at $a(0) = 1$.
You may choose the function a(t) (a simple linear function is fine, or you
could try more complicated things if you wanted).
the duration of the tone, and the frequency omega. Choose a sampling frequency
that is a little bit higher than what you would need to safely represent
the 5th harmonic (according to the Nyquist criterion). Experiment until you
think you have an interesting example. Listen to the tone, and display its
spectrogram. Turn in a listing of your program
and a printout of your spectrogram.

You may look to sawchebdemo.m for inspiration.

Problem 2

Make the following modifications to syncdemo.m:

  • Modify the slave oscillator to produce a triangle wave instead of a
    a sawtooth. You’ll want to create a variable that keeps track of whether the
    wave is going up or down, and then add or subtract v_delta_slave(n) based
    on that variable. You’ll also need to put in the logic to switch directions
    when it hits the -1 or +1 extremes. Notice you’ll also need to modify the
    computation of v_delta_slave, since the wave has to go up and back down.
    For convenience, we’ll leave the master oscillator alone (i.e. it will still
    make a sawtooth.)

  • Change the sync effect so that when the master oscillator resets,
    the slave oscillator changes direction (instead of resetting to
    the negative extreme as in the original code).

Create what you think is an interesting example in which the master oscillator
frequency stays fixed, but the slave oscillator frequency (which should be
higher than the master oscillator frequency) changes over time. For variety,
don’t use a frequency of 220 Hz for the master oscillator. Turn in a listing
over your code, a spectrogram of your example (you don’t need to try to
interpret it), and a plot of a small time inverval of your wave that illustrates
the premature changing of direction. Also describe how how the sound of this
soft-synced triangle differs from the hard-synced sawtooth (this will be

Note: There are a lot of different definitions of soft-sync; I just made up
the one above. Different pieces of hardware use the term “soft-sync” to refer
to very different features.

Problem 3

Introduction To FM
, by Bill Schottstaedt. (There’s Lisp code;
don’t let that scare you. We won’t need it.)

(a) Use MATLAB to synthesize a tone via Frequency
Modulation (although it’s actually Phase Modulation, technically speaking).
Generate the wave according to the
formula in the document following the sentence “Given our formula
for FM, let’s assume, for starters, that f(t) is a sinusoid.” Let the
modulation index B be your shoe size, and let the carrier frequency equal
200 + the last two digits of your phone number, in Hertz. Let the modulation
frequency equal the carrier frequency.

I have provided the script fmsynth.m to get you
started. (Notice that I’ve added a phase variable theta; if you play with
changing the theta variable over time, say by uncommenting the
theta = linspace(0,2*pi,length(tt)) line, you’ll hear that the phase
relationship between the carrier and the modulator does matter. The effect
is extremely subtle, but it is audible. In what follows, we will leave the
phase constant throughout the tone.

This particular choice of modulator and carrier frequencies will produce
a harmonic spectrum. Estimate the amplitude of the fourth harmonic from the
magnitude of the FFT as plotted by the code provided by eyeballing the height
of the fourth harmonic. Include your FFT plot. (I have multiplied the
FFT by 2, and divided by the length of the FFT, so that a cosine with an
amplitude of 1 will appear as a spike with height 1. Don’t worry if you
haven’t had ECE4270; if you have, you’ll follow why I need to do those
calibration steps, but if you haven’t, you can take it on faith.)

Then, compute the exact value of the amplitude of the fourth harmonic via the
formula in the document that appears right after the
phrase “or in slightly more compact form.” Write one line of MATLAB
code that will produce this value. Recall it will consist of the sum
of two Bessel functions; one will correspond to a sideband with a
negative frequency that folds over.

(b) Now let’s complicate things by repeating the steps of (a), except now
use the slightly more general expression that appears in the left hand side
of the equation right after the phrase “This is Chowning’s version
of the expansion. In general:” You can let phi be zero, since it won’t change
the sound at all, but let theta = pi/7 (note the case in (a) corresponded to
theta = 0). Estimate the amplitude of the fourth harmonic from the height
of the appropriate spike on the FFT plot (be sure to include the plot),
and then compute the exact value
using the right hand side of the equations right after the phrase
“This is Chowning’s version
of the expansion. In general:” Write one line of MATLAB code that will
produce this value. Notice that you will be adding two cosines with the
same frequency but different phases, so you will need to remember how to do
“phasor addition” to do this problem!

On both (a) and (b), note that your
FFT plots need not (and in fact shouldn’t) include the entire FFT;
just plot the interesting parts showing the main harmonics.

Problem 4

Check out
Ray Wilson’s Voltage Controlled Low Pass Filter (Four Pole 24db/Oct)
The input and feedback resistors are 100K; it looks like the divider is
made with a 1K to ground. (I find it interesting that he chooses to use
TL084 op amps as buffers instead of the buffers built in to the LM13700.
Maybe this is to avoid
having to deal with the weird 1.4 V drop you get from the LM13700 buffers?
The TL084 also are probably better quality than just the simple Darlington
pair in the LM13700.)

In parts (a) through (g), we will consider the gain of just
one of the filter stages,
either the second, third, or fourth (they are all the same; I’m not
including the first one so we can avoid the
effect of resisor coupling in the resonant feedback loop while working (a) and

a) Find the voltage at the input terminal of the OTA in terms of the
voltage at the output of the buffer and voltage
at the input of the filter block. Don’t make any approximations concerning
the resistors (i.e., if you use superposition, note that you must
compute the value of the little resistor in parallel with the
big resistor to solve this.)

b) In class, I attempted to use vigorous handwaving to attempt
to convince you that part (a) could be approximated as

v_at_ota = (v_input + v_output) *
(little_resistor / (little_resistor + big_resistor))

Comment on how close this approximation is to what you found in (a).

c) In class, I used even more vigorous handwaving to attempt to convince you
that part (a) could be further approximated as

v_at_ota = (v_input + v_output) *
(little_resistor / big_resistor)

Comment on how close this approximation is to what you found in (a) and (b).

d) Assume that the transductance gain
of the OTA is 19.2*I_con, where I_con
is the current flowing into the
control pin of the OTA.
What is the cutoff frequency of
the filter block in terms of (I_con) in Hertz, using the approximation
in part (c)? (Remember that the transconductance gain just takes the place of
1/R in the usual single-pole cutoff freuqency calculation, and for convenience
we include the scaling of the resistive divider as part of the transconducance

e) Given the result in (d), what value I_con would be needed for the
cutoff frequency of one stage to be 3000 Hz?

f) What single-stage cutoff frequency would you compute if you used the
I_con you computed in (e), but you used the no-approximation
technique of part (a)?

g) What single-stage cutoff frequency would you compute if you used the
I_con you computed in (e), but you used the approximation in part (b)?
Comment on how close the cutoffs computed in (f) and (g) are to 3000 Hz.

h) Now let’s consider the full four-pole cascade with feedback level
denoted as K, as in lecture. Let the
cutoff frequency of a single stage be 3000 Hz. On the same plot, show the
magnitude of the frequency response (with the horizontal axis in Hertz),
from DC to some value that you think best shows off the curves, for four
cases: K=0, K just big enough so that you can just barely see a resonance
“bump” in the curve, K close to 4 (but not so big that it swamps your other
curves), and a K somewhere between the last two cases that you think is
interesting. Make sure the value at DC corresponds with the results computer
by the simple formula derived in lecture.

Problem 5

In this problem we’ll look at the
Oberheim OB-Mx.
Strangely, Tom Oberheim had nothing to
do with this synth; Gibson had bought the rights to the Oberheim name.
Don Buchla was called in to try to save the project, but it eventually
wound up released before it was really ready against Buchla’s wishes.

If you don’t see a specific unit on a capacitor, there’s usually an implied

a) The Moog transistor ladder VCF contains a cascade of four
one-pole lowpass filter sections. Find the cutoff frequency of
one of those sections in the OB-MX’s transistor ladder
as a function of the control current
being pulled from the tied emitters of the transistor pair that feeds
the ladder. Two things to note: 1) Notice that when analyzing the Moog
VCF, we don’t include a
resistive divider in the gain as we’ve done in other OTA-C cutoff computations;
there is a resistive divider right at
the first input, but it’s not important for our frequency analysis. 2)
I initially
wrote expressions on the board for a one-sided ladder; for a real
Moog two-sided ladder, the control current gets split between the two
halves of the ladder, so you get a transconductance gain from each
transistor pair that’s like that of an OTA, and the formula for the
cutoff is basically the same as for the OTA-C filters we looked at
earlier (except we leave out the resistive divider).

b) Let’s do some DC analysis.
At DC, the caps are open circuits.
Supposing that the transistors draw negligible
current through the bases, what are the voltages
at the bases of the four stages of the
ladder? (Number the stages 1 through 4, from bottom to top).