Electronic Music
Dr Ian Drumm
Physical Modelling
Sound Synthesis
• Aims
– Introduce physical modelling as a sound
synthesis technique
• Learning outcomes
– Discrete time domain representation
– Digital Waveguides
– Tuning waveguides
– Realistic boundary conditions
What is physical modelling?
• Traditional techniques synthesise waveforms
usually with respect to analysis of real acoustic
waveforms.
• Physical modelling emulates the sound
production process of real instruments
• Technique suited for digital implementation
• Computationally expense becoming less of and
issue
– Computers become faster/cheaper
– Optimisations
Why physical modelling?
• Traditional techniques
– feedforward … source->filter
– control parameters don’t directly reflect players
experience
• Physical modelling
– takes account of two way (often non-linear)
interaction between excitation source and filter
(feedback)
– control parameters intuitive (e.g. soft/hard plucking,
blowing pressure).
– greater potential for expression
– more realistic emulations – and opportunities for
creative synthesis
• Characterise excitation source’s behaviour
over a range amplitudes
• Characterise resonator (usually does not
depend on amplitude of signal passing
through it)
Waveguides
y 2
2 y
2
T
• Wave equation c c
L
t 2
x 2
• Da Lembert’s solution
y f1 (ct x) f 2 (ct x)
Signal in digital domain
• Discrete time interval T
• Time elapsed t n nT
Waveguide in digital domain
• Discrete distance interval X cT
• Distance travelled x m mX
Digital Waveguide Theory
Putting solution in discrete time domain
y f1 (ct n x m ) f 2 (ct n x m )
y f1 (cnT mX ) f 2 (cnT mX )
y f1 (cnT mcT ) f 2 (cnT mcT )
y f1 (cT n m) f 2 (cT n m)
Knowing c and T are constant
y y ( n m) y ( n m)
• So y is a function of indexes to the digital signal
and waveguide hence we can model wave
propagation by shifting values along digital
waveguides in both forward and backward
direction.
Rigid Boundary Condition
• Assume rigid boundary x=0, y=0
y f1 (ct x) f 2 (ct x)
f1 ct f 2 ct 0
f1 ct f 2 ct
Rigid Boundary Condition Digital
Domain
• Previous suggests discrete signal elements
multiplied by gain of -1 at boundary
How long should digital waveguide be?
• E.g. require A at 440Hz at sample rate of 20000Hz
• Sample interval
1 1
T 0.00005 s
f sample _ rate 20000
• It takes to travel along waveguide t n nT
• Gives frequency
f 1
nT
1
n n=1/(440*0.00005) = 44.455~44 or 45 samples
fT
Linear Interpolation
• If we wanted to find y3 given
delay d we would look at other
points and interpolate
• Given the gradient is constant
(linear)
y 2 y1 yd y2 y y1
t t t t t t t d t 2 y 2
y d 2
2 1 d 2 2 1
y1 y 2
yd t t d y 2
Where d t d t 2
1 2
• Writing this in the discrete time
domain
y[n d ] y[n 1] y[n]d yn
Tuning waveguide
• Add fractional delay d to waveguide
y[n d ] y[n 1] y[n]d yn
y[n d ] dz 1 (1 d ) y[n]
• Linear interpolation work best with lower
frequencies
All pass interpolation
• An all pass filter can
be thought of as a
combination of low
and high pass filters
• No resulting change
in amplitude with
respect to frequency
• Does change phase
hence can add delay
to delay line
Tuning Waveguide with All Pass Filter
• Difference equation for all pass filter
y[n] ax[n] x[n 1] ayn 1
• Magnitude response G(ω) and phase response Θ(ω)
Y ( z ) aX ( z ) z 1 X ( z ) az 1Y ( z )
jT
1 1
Y ( z ) az Y ( z ) aX ( z ) z X ( z ) ze
Y ( z ) a z 1
H ( z)
X ( z ) 1 az 1
G H e jT
arg H e jT
Tuning Waveguide with All Pass filter
• The coefficient a can be given in terms of
delay Δ
1
a
1
More realistic boundary conditions
• Consider body response for real instruments
• Can measure with accelerometer / tuned hammer
• Could convolve body response with waveguide;
finite impulse response filter
y[n] b0 xn b1 xn 1 b2 xn 2....
• Large number of coefficients required hence
computationally expensive to apply each cycle
• For efficiency could employ Infinite Impulse
Response filter (e.g. Biquad)
• Difference equation for biquad filter
b0 xn b1 xn 1 b2 xn 2 a1 yn 1 a 2 yn 2
y[n]
a0
• Response
b0 X ( z ) b1 z 1 X ( z ) b2 z 2 X ( z ) a1 z 1Y ( z ) a 2 z 2Y ( z )
Y ( z)
a0
a0Y ( z ) a1 z 1Y ( z ) a 2 z 2Y ( z ) b0 X ( z ) b1 z 1 X ( z ) b2 z 2 X ( z )
Y ( z ) b0 b1 z 1 b2 z 2
H ( z)
X ( z ) a0 a1 z 1 a 2 z 2
E.g. Design For Low pass filter :
E.g. Acoustic Guitar
• Body of instrument has modes
– Bending mode (~60Hz) – guitar bends like
free beam
– Breathing mode (~100Hz) – guitar top and
bottom plates move out of phase sucking air
in and out
– Higher modes (~190Hz, 200Hz, etc, etc)
• Could model by finding coefficients of for
corresponding band pass filters