Teaching

Resources relating to my teaching are collected here. See also the Resources page for some related tools and demos.

Musical Applications of Fourier Theory and DSP (course link)

Lecture 1: Signals, Sinusoids, and Complex Exponentials

Building a sound out of sinusoids

Shows that by adding together just the right amplitude and phase of a set of sinusoids, a complex audio signal can be synthesised.

Any mono audio signal is exactly the sum of sinusoids at its DFT frequencies. Add them in from the lowest frequency upward, and listen to the sound assemble itself.

Quantisation and bit depth in digital audio Explore the effect of level quantisation, controlled via bit-depth, on the sound of digital audio files.
Taylor series reconstruction Interactive demo showing Taylor series reconstruction of a few common functions.
Cosine and sine functions as projections from a rotating phasor Interactive animation illustrating the generation of cosine and sine functions from a rotating phasor.
Beating and psychoacoustic roughness What happens if we add together a pair of periodic signals where the frequencies are similar, but not quite the same? If the signals are simple sinusoids, we get interesting “beating” effects. If the signals are each rich in harmonics, such as sawtooth waves, human listeners experience quite particular psychoacoustic effects – sometimes called “roughness”.
Damped sinusoids and complex frequency Interactive demo showing the generation of a damped sinusoid via the idea of complex frequency.

Lecture 2: Continuous-time Spectral Representations

Two phasors make a single real sinusoid Interactive demo showing how a pair of oppositely rotating phasors (one of positive frequency, one of negative frequency) combine to make a single real sinusoid.
The spectrum as a recipe Interactive demo showing how a combination of just a handful of sinusoids can produce a time waveform that is complicated, and potentially even not periodic.
Using Fourier series to build audio waveforms Interactive demo showing an audio waveform is created by combining 1 or more harmonic frequency components.

Lecture 3: Discrete-time and Basic Filters

Sampling a complex phasor Interactive demo showing how sampling a complex phasor at discrete time intervals creates a discrete-time signal. Concepts such as aliasing and bandwidth are included.
The wagon wheel and aliasing Interactive demo showing the classic demonstration of aliasing and folding.
Digital synthesis of square and sawtooth waveforms Synthesising a square wave, or sawtooth wave, will give very different results, depending on how the wave is put together. A partial Fourier series sum, via the frequency domain, is a much better way that naively making a “square” waveform in the time domain.

Lecture 4: LTI Systems in Discrete Time

Numerical measurement of FIR frequency response Impulse responses of various basic feedforward (FIR) filters are applied to different inputs, and the resulting output plotted point-by-point. Taking the magnitude of the result provides a numerical estimate of the frequency response at the given frequency.
Discrete convolution step-by-step The output of an LTI filter y[n] can be obtained by convolving an input x[n] with the filter’s impulse response h[n]. This discrete convolution operation can be understood as “flipping” h and running it over x, computing the sum of point-wise products of the overlapping samples at each time step.

Lecture 5: The Discrete Fourier Transform

Building a sequence from its DFT (the inverse DFT) We use the bin entries of the forward DFT to compute the time-domain sequence via the inverse DFT.

Lecture 6: Properties of the Discrete Fourier Transform

Linear vs. circular time delays For an N-length signal, time delay has a very different effect depending on whether the delayed samples move outside the window (linear delay) or are wrapped back around (circular delay).
The DFT samples the DTFT (on-bin vs. off-bin signals, and DFT leakage) The DFT can be understood as a sampling of a signals DTFT. Depending on whether the signal includes only components that are periodic over the analysis window (on-bin), or components that are not periodic (off-bin), leakage is either invisible, or very obvious, in the DFT we see.
Circular vs linear convolution Consider signals x[n] and h[n], of length N_x and N_h samples, respectively. Circular and linear convolution are different ways of convolving these signals together. Circular convolution is associated with multiplying N-length DFTs, meaning that either x or h, whichever is shorter, is padded to the length of the other – let’s call this length N samples. Multiplying their spectra causes output samples “beyond” N to wrap around into the start of the analysis window. This is known as time-domain aliasing, since the output must be N samples long.

In contrast, linear convolution is implemented in the time domain to produce a signal of length N_x + N_h -1.

Circular convolution can lead to the same result as linear convolution if the two time-domain signals are first padded to a length N_x + N_h -1 samples, before being transformed via the DFT into their frequency domain representations. Indeed, this is exactly how so-called ‘fast’ or ‘frequency domain’ convolution is achieved.

Leakage and windowing functions Different windowing functions have different spectral properties, and these affect how easy it is to discriminate between a pair of sinusoids of different frequency.

Lecture 7: The Short-Time Fourier Transform

STFT and spectrogram representation: Plotting and manipulating a sound in the frequency domain The short-time Fourier transform (STFT) is a sequence of discrete Fourier transforms applied to successive, usually overlapping, “frames” of an audio signal. Plotting the magnitude of these succession of DFTs gives us the classic spectrogram representation, with time running left to right, frequency running vertically, and some kind of greyescale or colour mapping indicating DFT magnitude. In this demo a basic spectrogram is plotted, along with various interesting manipulations of it, such as zeroing out the phase (either to a whole-signal single DFT, or frame-by-frame).

Use the preset musical scale, or load or record your own sound.

The window overlap sum In analysis–synthesis audio processing we usually apply a tapered window at both analysis and synthesis stages. This means the net effect on the synthesised signal is application of a squared window function. Adding this up along the length of the output gives us the window overlap sum.

Calculating the window overlap sum a-priori, or keeping track of it in a loop used to synthesise the output, we can “divide it out” of the output signal (e.g., a time-stretched version of the input), ensuring any amplitude modulation caused by certain synthesis hop spacings H_S are removed.

Lecture 8: The z-Transform

Generating a discrete-time signal from powers of z A point on the z-plane is a single complex number. It can be used to generate a signal if we raise it to the power n. A sequence z^n always starts at z^0 = 1, and each new sample is the last one multiplied by z:

    \begin{equation*} 1, \quad z, \quad z^2, \quad z^3, \quad \dots \end{equation*}

.

Together these numbers constitute a discrete-time sequence, in the form of a damped complex exponential phasor. The real part of this sequence is a damped sinusoid.

The z-surface and the DTFT This interactive demo visualises the z-surface, and the way that the DTFT can be read from it as its value around the unit circle.
Poles, zeros, and the z-plane LTI filters can be defined in terms of their poles and zeros. In this animation, poles and zeros can be interactively added to the z-plane, and the resulting frequency response magnitude and phase plotted. The filter’s difference equation is also shown. The demo is also a way demonstrate intuitively the concept of filter stability.
How the poles of a filter generate its impulse response The impulse response of a (real) filter is a weighted sum of the signals generated by its conjugate poles. For each conjugate pole pair, the angle \pm\hat{\omega}_0 sets the frequency at which the filter “rings”, and the distance from the origin \rho sets how quickly that ringing decays (or grows).

Lecture 9: The z-Transform (II)

The length of an impulse response, and what we hear TBC
Feedback comb filters: From frequency shaping to tape delay via string synthesis TBC
Peaking and shelving filters on the z-plane A single biquad, set up as a peaking filter, a low shelf, or a high shelf. Adjust f_c, G, and Q, and watch the poles and zeros move on the z-plane (a magnified view shows the region near the unit circle), with the magnitude response also drawn below. You can also listen to a sound with the filter in and out.
A three-band parametric EQ Play around with a three-band parametric EQ made from two shelving filters and a peaking filter. Notice how relatively independent the filters are as long as their f_c values are spaced reasonably apart in frequency.