Professional Documents
Culture Documents
2
Digital Audio Synthesis
• Several Approaches:
‣ Subtractive synthesis
‣ Additive synthesis
‣ Sample-based synthesis
‣ Wavetable synthesis
‣ Granular Synthesis
‣ Physical Modeling
3
Subtractive Synthesis
• Basic Idea:
‣ Subtract overtones from a sound via sound synthesis, characterized by the
application of an audio filter to an audio signal.
• Ex:
‣ Take the output of a sawtooth generator
‣ Use a low-pass filter to dampen its higher partials generates a more natural
approximation of a bowed string instrument than using a sawtooth generator
alone.
4
Subtractive Synthesis: A Human Example
- Change of mouth shape varies the cutoff frequency of the filter, so removing
(subtracting) some of the harmonics.
- The “aah” sound has most of the original harmonics still present
- The “ooh” sound has most of them removed (or to be more precise, reduced in
amplitude.)
5
tive synthesis: Electronic Control
Subtractive synthesis: Electronic Control
elements:
c elements:
al: •Common
Three basicsource
elements:signals: square
al: waves,
Common pulsesource
waves, signals:
sawtoothsquarewaves
‣ Source signal:
waves,
and pulsewaves.
triangle waves, sawtooth waves
- Common source signals: square waves,
andpulse
triangle
waves,
waves.
sawtooth(digital
waves andand triangle
Modern synthesisers
waves.synthesisers (digital and
Modern
software) may include more complex
- Modern synthesizers
software) may include(digital
more and complex
software)
waveforms or allow the upload
may include more complex waveforms or
of
waveforms
arbitrary or allow
waveforms the upload of
allow the upload of arbitrary waveforms
arbitrary waveforms
‣ Filtering: the cut-off frequency and
g: The cut-o↵ frequency and resonance
ng: ofTheresonance
cut-o↵ offrequency
the filter areand
controlled in
resonance
the filter
order are controlled
to simulate in order
the natural timbre of a
of the
to given filter
simulate are controlled in
the natural timbre of a order
instrument.
to simulate the natural timbre of a
given instrument.
‣ Amplitude Envelope:
given instrument.
- Further envelope control of signal amplitude (strictly: not subtractive synthesis
but frequently used). Also used with other synthesis techniques.
de Envelope: Further envelope control of signal amplitude
ude Envelope: Further envelope control 6
of signal amplitude
dditive synthesis
Basic Idea: Additive synthesis
Additive synthesis refers to the idea that complex tones can be
• Basic by
created Idea:
the summation, or addition, of simpler ones.
‣ Additive synthesis refers to the idea that complex tones can be created by the
summation, or addition, of simpler ones.
Frequency
- Frequency mixing
mixing is the
theessence
essence
of
of additive
additive synthesis.
synthesis.
- Each of the frequency components
Each(orof the frequency
partials) of a sound components
has its own
(or amplitude
partials) envelope.
of a sound has its own
- This allows
amplitude envelope.
for independent behavior
of these components.
This allowscan
- Sources forbeindependent
other forms of
behaviour
synthesisoforthese components.
samples.
Magnitude
1.0 1.0
0.0 0.0
0.5 0.5
Magnitude
Magnitude
−0.5 −0.5
0.0 0.0
−1.0 −1.0
−0.5 0.0 0.2 0.4 0.6 0.8 1.0 −0.5 0.0 0.2 0.4 0.6 0.8 1.0
Time Time
−1.0 −1.0
0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0
(a)
Time (b)
Time
cos (cos (4 t)) cos (2 t + cos (4 t))
(a) (b)
1.0 1.0
cos (cos (4 t)) cos (2 t + cos (4 t))
0.5 0.5
Magnitude
Magnitude
1.0 1.0
0.0 0.0
0.5 0.5
Magnitude
Magnitude
−0.5 −0.5
0.0 0.0
−1.0
−0.5 −1.0
0.0 0.2 0.4 0.6 0.8 1.0 −0.5 0.0 0.2 0.4 0.6 0.8 1.0
Time 8 Time
Sample-based synthesis
• Basic Ideas: Similar to subtractive synthesis or additive synthesis.
• The principal difference is that the seed waveforms are sampled sounds or
instruments instead of fundamental waveforms such as the saw waves of
subtractive synthesis or the sine waves of additive synthesis.
• Musical genres: Hip-hop, Trip-hop, Dance music, Garage, Jungle, Trance,
Modern Electronica invented due to samplers.
• Most music production now uses samplers.
9
Sample-based synthesis: Comparison with
other Synthesis methods
• Advantages:
‣ Processing power requirements are much lower.
10
Sample-based synthesis Basics: Looping
• Looping today:
‣ Looping still useful for
11
Sample-based synthesis Basics: Looping
12
Wavetable synthesis
• Similar to simple digital sine wave generation/additive synthesis but
extended at least two ways:
‣ Waveform lookup table contains samples for not just a single period of a sine
function but for a single period of a more general waveshape.
‣ Mechanisms exists for dynamically changing the waveshape as the musical
note evolves: generating a quasi-periodic function in time.
13
Wavetable synthesis: Advantages
• Well suited for synthesizing quasi-periodic musical tones because wavetable
synthesis can be as compact in storage requirements
‣ Amount of data being stored and used for this synthesis method is far less
than just the PCM sample of same sound.
‣ As general as additive synthesis but requires much less real-time
computation.
• Wavetable synthesis takes advantage of the quasiperiodic nature of the
waveform to remove redundancies and to reduce the data.
14
Granular Synthesis
• ”All sound is an integration of grains, of elementary sonic particles, of sonic
quanta.” -Iannis Xenakis, Greek Composer (1971).
• Granular Synthesis
‣ Sound synthesis method that operates on the microsound time scale.
15
Granular Synthesis: Making Sounds
• Sounds made by the generation of thousands of short sonic grains:
‣ Combined linearly to form large scale audio events
‣ 3 possible combinations:
16
anular Synthesis: Making Sounds (Cont.)
A grain stream of equal duration grains, produces amplitude
Granular
modulation
Quasi-synchronous
Synthesis:
(see later) Making Sounds
grain durations less than 50 ms.
withsynthesis:
granular
• Quasi-synchronous
A grain stream of granular synthesis:
equal duration grains, produces amplitude
‣modulation (seeof later)
A grain stream with grain
equal duration durations
grains, less
produces than 50modulation
amplitude ms. with
grain durations less than 50 ms.
Grain streams with variable delay time between grains: the sum of
which‣ Grain
resembles
streams asynchronous
with variable delay granular synthesis.
time between grains: the sum of which
Grain streams with variable delay time between grains: the sum of
resembles asynchronous granular synthesis.
which resembles asynchronous granular synthesis.
17
Granular Synthesis: Making Sounds (Cont.)
Granular Synthesis: Making Sounds
Asynchronous granular synthesis:
• Asynchronous granular synthesis:
‣Grains
Grains are distributedstochastically
are distributed stochastically
with with no regularity.
no quasi quasi regularity.
18
Granular Synthesis: Making Sounds
• Pitch/Tempo-synchronous granular synthesis:
‣ Preserve Pitch/Tempo while altering sample playback speed
19
Physical Modeling
• Physical modeling synthesis
‣ The synthesis of sound by using a mathematical model: sets of equations and
algorithms to simulate a physical source of sound.
- Sound is generated using model parameters that describe the physical
materials used in the instrument and the user’s interaction with it
- For example, to model the sound of a drum, there would be a formula for how
striking the drumhead injects energy into a two dimensional membrane.
20
Physical Modeling Example
• Karplus-Strong Algorithm
‣ Simple Algorithm: Makes a musical sound from noise
Physical Modelling Exampe
- Loops a short noise burst through a filtered delay line to simulate the sound of
a hammered or pluckedAlgorithm
Karplus-Strong string or some types of percussion.
- Feedback,Simple
Filtering and delay.
Algorithm: Makes a musical sound from noise
- Essentially subtractive
Loops a short noise burst
synthesis throughbased
technique a filtered
ondelay line to loop similar to
a feedback
that of a combsimulate
filter. the sound of a hammered or plucked string or
some types of percussion.
TD
22
Effects Types
• Audio effects can be classified by the way process signals:
‣ Basic Filtering: Lowpass, High pass filter etc., Equalizer
23
Time-varying Filters
• Some common effects are realized by simply time varying a filter in a couple
Wah-wah Example
of different ways:
‣ Wah-wah: A bandpass filter with a time varying centre (resonant) frequency
The signal flow
and a small for a wah-wah
bandwidth. ismixed
Filtered signal as follows:
with direct signal.
direct-mix
x(n) + y(n)
Time
Varying wah-mix
BP
where BP is a time varying frequency bandpass filter.
‣ Phasing: A notch filter, that can be realized as set of cascading IIR filters,
again mixed with direct signal.
• A phaser is similarly implemented with a notch filter replaci
the bandpass filter.
• A variation is the M -fold wah-wah filter where M tap del
24
Time Varying Filter Implementation:
State Variable Filter
• Time varying filter: independent control over the cut-off frequency and
damping factor of a filter.
• We can implement a State Variable Filter to solve this problem.
25
State
The State Variable
Variable Filter Filter
yh (n) F1 yb (n) F1 yl (n)
x(n) + + + +
T T
1 Q1
T
1
T
‣ x(n): input signal
where:
‣ yl(n): lowpass signal
x(n) = input signal
‣ yb(n): bandpass signal
y
‣ yh(n): highpass signal l (n) = lowpass signal
yb(n) = bandpass signal
y (n) = highpass
26 signal
TheState Variable Filter
The State Variable Filter Algorithm
State Variable Filter Algorithm
The algorithm difference equations are given by:
The algorithm difference equations are given by:
• The difference equations are given by:
219
yl (n) = F1yb(n) + yl (n 1) 219
y l (n) = F1 yb (n) + yl (n
yb(n) = F1yh(n) + yb(n 1) 1)
y yb(n)
(n) = F1yh(n)y+(nyb(n1) 1)Q y (n 1)
= x(n)
h l 1 b
yh(n) = x(n) yl (n 1) Q1yb(n 1)
with tuning coefficients F1 and Q1 related to the cut-off frequency,
with tuning
with coefficients
tuning F1 andFQ1and
coefficients related
Q to the to
related cut-off
the frequency
cut-off fc and
frequency,
fc, and damping, d: 1 1
damping
fc, andd damping, d:
F1 = 2 sin(⇡fc/fs), and Q1 = 2d
F1 = 2 sin(⇡fc/fs), and Q1 = 2d
JJ
JJ
II
IIJ
JI
I
Bac
Back
Clos
Clos
27
Delay Based Effects
• Many useful audio effects can be implemented using a delay structure:
‣ Sounds reflected of walls
28
FIR Comb Filter
• This simulates a single delay:
‣ The input signal is delayed by a given time duration τ
‣ The delayed (processed) signal is added to the input signal some amplitude
gain g
‣ The difference equation is simply:
y(n) = x(n) + gx(n − M) with M = τ / fs
‣ The transfer function is:
H(z) = 1 + gz-M
29
FIR Comb Filter
y(n)
x(n) +
1
TM
x(n M)
30
IIR Comb Filter
• This simulates a single delay:
‣ Simulates endless reflections at both ends of cylinder.
‣ The input signal circulates in delay line (delay time τ ) that is fed back to the
input..
‣ Each time it is fed back it is attenuated by g.
31
IIR Comb Filter
y(n)
x(n) +
c
TM
y(n M)
32
versal Comb Filter
Universal Comb Filter
combination of the FIR and IIR comb filters yields the Uni
b Filter:
• The combination of the FIR and IIR comb filters yields the Universal Comb
Filter:
sically this is an allpass filter with an M sample delay ope
‣ Basically this is an allpass filter with an M sample delay operator and an
d an additional
additional multiplier,
multiplier FF. FF.
BL
FF
x(n M) y(n)
x(n) + TM +
Parameters: FF = feedforward,
FB FB = feedbackward, BL = blend
33
Universal Comb Filter Parameters
234
BL FB FF
FIR Comb 1 0 g
IIR Comb 1 g 0
Allpass a a 1
delay 0 0 1
JJ
II
J
I
Back
Close
34
Vibrato - A Simple Delay Based Effect
0.2
0.1
−0.1
−0.2
−0.3
−0.4
0 50 100 150 200 35
250 300 350 400 450 500
Comb Filter Delay Effects:
CombFlanger,
Filter Delay Effects:
Chorus, Slapback, Echo
Flanger, Chorus, Slapback, Echo
• A few
•Apopular effectseffects
few popular can becan
made with a
be made comb
with filter filter
a comb (FIR (FIR
or IIR) and some
or IIR)
modulation
and some modulation 240
• Flanger, Chorus,
• Flanger, Slapback,
Chorus, Echo Echo
Slapback, samesame
basicbasic
approach but but
approach different sound
different
sound outputs:
outputs:
36
langer MATLAB Example (Cont.)
Flanger
The output from the above code is (red plot is original audio):
Flanger and original Signal
1.5
0.5
−0.5
−1
−1.5
0 5 10 15
4
x 10
0.5
−0.5
−1
Original Audio
0 5 10 15
4
x 10