Lecture 5 · Comb filters, fractional delays, vibrato, flanger, chorus, plucked strings
| Block | Representation | Generator |
|---|---|---|
| Filters and effects | LTI and time-varying systems | hand-designed |
| Classical synthesis | samples, partials, modes, physical state | hand-designed |
| DDSP | the same structured models | parameters learned |
| Reverberation | a recursive dynamical system | hand-designed, fittable |
| Diffusion | a learned representation | learned |
The four questions
Filters and effects, part 4 of 5. Last time: parametric and time-varying filters. Today: delay lines: combs, modulated delays, and a delay line with feedback that becomes a plucked string.
FIR comb filter
\(H(z) = 1+gz^{-M}\)
\(\left|H\left(e^{j\Omega}\right)\right|=\sqrt{1+g^2+2g\cos M\Omega}\)

IIR comb filter
\(H(z) =\dfrac{c}{1-gz^{-M}}\)
\(\left|H\left(e^{j\Omega}\right)\right| = \dfrac{c}{\sqrt{1+g^2-2g\cos M\Omega}}\)

| dry: the guitar DI of the course | |
| FIR comb, \(g = 0.9\), \(M = 44\) (1 ms): notches every 1 kHz, from 501 Hz | |
| IIR comb, \(g = 0.9\), \(c = 1-g\), \(M = 44\): peaks every 1 kHz |
| \(bl\) | blend parameter |
| \(ff\) | feed forward |
| \(fb\) | feed back |
| \(bl\) | \(fb\) | \(ff\) | |
|---|---|---|---|
| FIR comb filter | 1 | 0 | \(g\) |
| IIR comb filter | \(c\) | \(g\) | 0 |
| allpass | \(a\) | \(-a\) | 1 |
| delay | 0 | 0 | 1 |
discrete version of a variable analog delay line
fractional delay line
with linear interpolation
\(\displaystyle y(t)=x(t-\tau)\)
sampling with \(\displaystyle t=kT\)
\(\displaystyle y\left[k\right]=x\left[k-\tau/T\right]\)
if \(\displaystyle \tau/T\) not integer:
\(\displaystyle M =
\left\lfloor\frac{\tau}{T}\right\rfloor,\:\mathrm{frac}=\frac{\tau}{T}-M\)
linear interpolation \[\begin{array}{rcl}\displaystyle
y[k] &\displaystyle \approx &\displaystyle x[k-M](1-\mathrm{frac})+\\\displaystyle
&\displaystyle &\displaystyle +x[k-(M+1)]\mathrm{frac}
\end{array}\] higher order interpolation:
higher accuracy

T. I. Laakso et al., “Splitting the unit delay,” IEEE Signal Processing Magazine, 1996.
periodically variable delay line \(\rightarrow\) periodically variable pitch
Typical values
| delay | \(\displaystyle \tau = 5\:\ldots\:10~\mathrm{ms}\) |
| LFO | \(\displaystyle f = 5\:\ldots\:14~\mathrm{Hz}\) |
periodically variable FIR comb filter
Typical values
| delay | \(\displaystyle \tau = 0\:\ldots\:15~\mathrm{ms}\) |
| LFO (sine) | \(\displaystyle f \approx 1~\mathrm{Hz}\) |
randomly variable FIR comb filter
Typical values
| delay | \(\displaystyle \tau = 10\:\ldots\:25~\mathrm{ms}\) |
| noise | lowpass noise |
| dry: the guitar DI of the course | |
| vibrato: \(\tau = 7 \pm 1\) ms, sine LFO 6 Hz | |
| flanger: \(g = 0.9\), \(\tau = 0.5\) … 10 ms, sine LFO 0.7 Hz | |
| chorus: \(g_1 = g_2 = 0.7\), \(\tau_1 = 13 \pm 3\) ms, \(\tau_2 = 21 \pm 3\) ms, low-pass noise (1.5 Hz) |
repeated readout of the same content (looping)
oscillator with arbitrary wave shape
sound modification by filters in the feedback path (loop filter)

arbitrary waveforms possible \(\rightarrow\) sound synthesis, wavetable synthesis
tapped delay line \(\longrightarrow\) FIR filter
feedback filter \(y[k] = \frac12 ( v[k] + v[k-1])\)
\(H(e^{j\Omega}) = \displaystyle\frac{Y(e^{j\Omega})}{V(e^{j\Omega})} =
\frac12 \left( 1 + e^{-j\Omega} \right) =
e^{-j\Omega/2}\cos(\Omega/2)\)
\[|H(e^{j\Omega})| = \cos(\Omega/2)\]



Feedback with an arbitrary loop filter
\(H(z)\): Modeling of frequency dependent damping, dispersion, and reflections
\(\longrightarrow\) sound synthesis, digital wave guide
Let’s build a Karplus Strong Model
Starting point: Simple delay line of length \(M\)
Not very impressive…
Extension: Let’s add some feedback
Still not very impressive…
But: Delay line with feedback allows looping of a stored signal (see wavetable synthesis)
Extension: Let’s add a very simple averaging operation
Interpretation: Tapped delay line + FIR filter
What do you think?
Feedback filter: \[y[k] = \frac{1}{2}\left(v[k] + v[k-1]\right)\] \[H(e^{j\Omega}) = \frac{Y(e^{j\Omega})}{V(e^{j\Omega})} = \frac{1}{2}\left(1 + e^{-j\Omega}\right) = e^{-j\Omega/2}\cos(\Omega/2), \qquad |H(e^{j\Omega})| = |\cos(\Omega/2)|\]
Second sound example & further sound examples: ccrma.stanford.edu/~jos/Mohonk05

The averager reads cells \(M-1\) and \(M\), so the loop is \(M - \frac12\) samples long and with integer \(M\) only the pitches \(f_0 = f_\mathrm{s}/(M - \frac12)\) exist:
A first-order allpass fractional delay in the loop tunes every note to within about 0.2 cents.
D. A. Jaffe, J. O. Smith, “Extensions of the Karplus-Strong plucked-string algorithm,” Computer Music J., 1983 · try it: Karplus–Strong notebook
Further effects
reverberation
(IIR: algorithmic reverberation, FIR: convolution reverberation)
limiters, compressors, noise gates
digital simulation of analog devices
vacuum tube amplifiers (amp simulation, modeling amps)
analog synthesizers (virtual analog)
old digital synthesizers (LoFi)
voice effects
pitch quantization
(e.g. Auto-Tune, “Cher effect”, Cher, Believe, 1998)
gender change
and many more …
Tune a string
Karplus–Strong at \(f_\mathrm{s} = 44.1\) kHz with a delay line of \(M = 100\) cells: which pitch do you hear? Which \(M\) would give A4 = 440 Hz, and how far off (in cents) is the closest integer \(M\)?
Try it: notebook (loop filters, excitation, tuning with a fractional delay), runs in the browser.
Comb filters
\(1 + g z^{-M}\) notches and \(\frac{c}{1 - g z^{-M}}\) peaks every \(f_\mathrm{s}/M\); the general comb with \(bl\), \(f\!f\), \(fb\) covers FIR, IIR, allpass and delay.
Modulated delays
A delay that moves needs a fractional delay (interpolation). An LFO or noise on \(\tau\) gives vibrato, flanger and chorus.
Delay + feedback = string
A looped delay line is a wavetable; with an averaging filter in the loop it is the Karplus–Strong plucked string, \(f_0 = f_\mathrm{s}/(M-\frac12)\).
Next lecture: from block diagrams back to circuits. Wave digital filters turn a schematic into a digital filter, nonlinear parts included.
Slides 1:1 from the LMS/FAU lecture notes (R. Rabenstein, M. Schäfer), Karplus–Strong slides from the WS 25/26 lecture slides (M. Schäfer); figures redrawn in TikZ (slides/filters_tikz/), plots re-plotted from the original Matlab scripts, added examples by the slides/make_filters_*.py scripts in the course repository.