Sie sind auf Seite 1von 11

The Delay Line

CMPT 889: Lecture 4


Delay
• The delay line is an elementary functional unit which
Tamara Smyth, tamaras@cs.sfu.ca
School of Computing Science,
models acoustic propagation delay. and delay effects
Simon Fraser University processors.
February 1, 2012
x(n) z −M y(n)

Figure 1: The M-sample delay line.

• The function of a delay line is to introduce a time


delay, corresponding to M samples between its input
and output
y(n) = x(n − M ), n = 0, 1, 2, . . .

• The corresponding transfer function is given by


Y (z)
H(z) = = z −M .
X(z)
• M poles at z = 0 and M zeros at z = ∞
• Allpass filter since |H(ejωT )| = 1.
• Linear phase since ∠H(ejωT ) = −M ωT .

1 CMPT 889: Computational Modelling for Sound Synthesis: Delay 2

The Simple Comb Filter Simple Comb Filter Impulse Response

• What happens when we multiply the output of a delay • Let the M sample delay correspond to τ seconds.
line by a gain factor g then feed it back to the input? • If the input to the filter is an impulse,
x(n) y(n) x(n) = {1, 0, 0, . . .} the output will have an impulse
g of amplitude 1 at n = 0, followed τ seconds later by
z −M
another impulse of amplitude g, followed again τ
Figure 2: The signal flow diagram of a comb filter. seconds later by another impulse of g 2 and so on.

• The difference equation for this filter is given by


Amplitude

y(n) = x(n) + gy(n − M ),


g
which is an IIR filter with a feedback coefficient g. g2
g3
• It’s corresponding transfer function is given by
0 τ Time (s)
1
H(z) =
1 − gz −M Figure 3: Impulse response for filter y(n) = x(n) + gy(n − M).

• The impulse response is therefore a sequence of


equally spaced impulses, each one with an amplitude
a factor of g times that of the preceding impulse.

CMPT 889: Computational Modelling for Sound Synthesis: Delay 3 CMPT 889: Computational Modelling for Sound Synthesis: Delay 4
Why is this a comb filter? The effect of the feedback coefficient

• The depth of the minima and height of the maxima


10
are set by the choice of g, where values closer to 1
Magnitude (dB)

5
yield more extreme maxima and minima.
0 Simple Comb Impulse Response (g = 0.5)
1

0.8

−5 0.6
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.4
Normalized Frequency (×π rad/sample)
0.2

40 0
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05

Simple Comb Magnitude Response (g = 0.5)


Phase (degrees)

20 8

4
0
2

−20 −2

−4
0 0.5 1 1.5 2 2.5 3 3.5

−40
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency (×π rad/sample) Figure 5: Impulse and Magnitude Response with g = 0.5.

Figure 4: Frequency Response of a Comb Filter.


Simple Comb Impulse Response (g = 0.9)
1

0.8

0.6

0.4

• The comb filter is so called because its amplitude 0.2

0
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05

response resembles the teeth of a comb. 20


Simple Comb Magnitude Response (g = 0.9)

15

10

• The spacing between the maxima of the “teeth” is 5

equal to the natural frequency. −5

−10
0 0.5 1 1.5 2 2.5 3 3.5

Figure 6: Impulse and Magnitude Response with g = 0.9.

CMPT 889: Computational Modelling for Sound Synthesis: Delay 5 CMPT 889: Computational Modelling for Sound Synthesis: Delay 6

Comb Filter cont. General Comb Filter

• Since the pulses are equally spaced in time at an • Consider now, adding to the filter a delay element
interval equal to the loop time τ , it is periodic and which delays the input by M1 samples, with some
will sound at the frequency f0 = 1/τ . gain g1.
• The response decays exponentially as determined by • The general comb filter is given by the difference
the loop time and gain factor g. equation
• Notice that values of g nearest 1 yield the longest y(n) = x(n) + g1x(n − M1) − g2y(n − M2)
decay times.
where g1 and g2 are the feedforward and feedback
Matlab example coefficients, respectively.
fs = 44100; %sampling rate g1
f0 = 220; %desired fundamental z −M1

M = round(fs/f0); %number of delay samples x(n) y(n)


g = 0.9; %feedback gain g2
z −M2

B = 1; Figure 7: Signal flow diagram for digital comb filters.


A = [1 zeros(1, M-1) g];

freqz(B, A);

CMPT 889: Computational Modelling for Sound Synthesis: Delay 7 CMPT 889: Computational Modelling for Sound Synthesis: Delay 8
Matlab Comb Filter Implementation Comb Transfer Function

g1 = (0.5)^3; The transfer function, defined by H(z) = Y (z)/X(z), is


g2 = (0.9)^5; given by
B = [1 0 0 g1]; Z{y(n)} = Z{x(n) + g1x(n − M1) − g2y(n − M2)}
A = [1 0 0 0 0 g2]; = Z{x(n)} + g1 Z{x(n − M1)}
N = 1024; −g2Z{y(n − M2)}
x = [1 zeros(1, N-1)]; Y (z) = X(z) + g1 z −M1 X(z) − g2 z −M2 Y (z)
y = filter(B, A, x); g2z −M2 Y (z) + Y (z) = X(z) + g1 z −M1 X(z)
Y (z) 1 + g1z −M1
H(z) , =
X(z) 1 + g2z −M2

1.5
Finding the tranfer function allows us to:
1
Amplitude

0.5

0
1. Find the frequency response by setting z = ejωT .
−0.5 2. Factor the transfer function to find the poles and
−1
0 5 10 15 20 25 30 35 40
zeros (see Digital Filters II)
Time (s)

Figure 8: Comb Filter Impulse Response.

CMPT 889: Computational Modelling for Sound Synthesis: Delay 9 CMPT 889: Computational Modelling for Sound Synthesis: Delay 10

Comb Frequency Response Comb Pole Zero

[zeros, poles, gain] = tf2zp(B,A);


zplane(zeros,poles);
• The frequency response is obtained by evaluating the
transfer function on the unit circle in the complex
plane, that is, by setting z = ejωT
1

jωT 1 + g1e−jM1 ωT
H(e ), , −π < ωT < π 0.8
1 − g2e−jM2 ωT 0.6

• The amplitude response is given by 0.4

−jM1 ωT

H(ejωT ) = 1 + g1e
Imaginary Part

0.2

1 + g2e−jM2 ωT 0

−0.2
• The phase response is given by
−0.4

∠H(ejωT ) = ∠ 1 + g1e−jM1 ωT −∠ 1 + g2e−jM2 ωT


 
−0.6

−0.8

−1

−1 −0.5 0 0.5 1
Real Part

Figure 9: Pole Zero Plot for Comb Filter.

CMPT 889: Computational Modelling for Sound Synthesis: Delay 11 CMPT 889: Computational Modelling for Sound Synthesis: Delay 12
A very simple string model Karplus-Strong Pluck String

• When the delay-line initial conditions consist of white


• A very simple string model can be implemented using noise, the algorithm is known as the Karplus-Strong
a single delay line and our simple first-order low pass algorithm.
filter to model frequency-dependent loss.
• White noise is a sequence of uncorrelated random
y(n) y(n − N )
z −N values, in which all frequencies are equally likely. This
can be generated in Matlab as:
H(z) y = randn(100, 1); % Gaussian white noise,
% zero mean and unit variance.
Figure 10: A very simple model of a rigidly terminated string. x = rand(100, 1); % white noise,
% uniform distribution between 0 and 1.
• All losses have been lumped to a single observation xn = 2*(x-0.5); % white noise,
% uniform distribution between -1 and 1;
point in the delay line, and approximated with our
first-order simple low-pass filter • Filling the delay line with white noise is akin to
1 + z −1 plucking the string with a random initial displacement
H(z) = ;
2 (and thus a random initial velocity) distribution—a
• The Karplus-Strong Algorithm may be interpreted as very energetic excitation..
a feedback comb filter (with lowpassed feedback) • What are the control parameters of this model?
or a simplified digital waveguide model.
• How do you pluck the string?

CMPT 889: Computational Modelling for Sound Synthesis: Delay 13 CMPT 889: Computational Modelling for Sound Synthesis: Delay 14

Controlling Karplus-Strong Limits of integer-length delay lines

• Dynamics: • At low frequencies (large N ), this is less of a problem,


– The most trivial is to limit the range of random but becomes increasingly problematic at higher
numbers: frequencies when delay-line lengths are small and a
x = rand(100, 1); % uniform distribution between 0 and 1. single sample delay can make a bigger difference.
xn = 2*(x-0.5); % uniform distribution between -1 and 1;
• Example: At fs = 44100, to obtain a frequency of
– The white noise serving as the initial conditions 882 Hz, a delay of fs/882 = 50 samples is required.
may be lowpass filtered, with the cut-off frequency The next highest possible frequency with an integer
giving a control of effective dynamic level (since number of samples is fs/49 = 900 Hz.
acoustic instruments are usually brighter at louder
dynamic levels). 8000
Integer Delay Frequency Quantization

• Sounding frequency (pitch) 7000

6000

– Change the delay line length, where


Quantized Frequency (Hz)

5000

4000

f0 = fs/(N + 1/2). 3000

– The 1/2 term in the denominator is due to the 2000

1000

low-pass filter’s phase delay of 1/2 sample (shown 0

in notes on filters).
0 1000 2000 3000 4000 5000 6000 7000 8000
Desired Frequency (Hz)

Figure 11: As the desired frequency gets higher, it becomes quantized to fewer possible
– Notice that the delay-line length is of an integer values. Notice for example, there is a single frequency value for all desired frequencies
size. This limits the resolution of possible sounding between 7000 and 8000 Hz.

frequencies.

CMPT 889: Computational Modelling for Sound Synthesis: Delay 15 CMPT 889: Computational Modelling for Sound Synthesis: Delay 16
Linear Interpolation Frequency-dependent decay rate

• Linear interpolation is the simplest of interpolation • Another (control) problem with the KS is that,
schemes. because of the low-pass filter in the feedback loop,
• If a delay value is 6.5 we would intuitively take the the decay rate is dependent on frequency.
outputs after delays of 6 and 7 samples then take the Plucked string at 441 Hz
1
value that is half-way between them. 0.8

• If our delay value is M = 6.9749, we may still take

Amplitude
0.6

the outputs at the surrounding integer sample delays 0.4

0.2
6 and 7, but we would scale them differently, giving 0
0 0.5 1 1.5 2 2.5 3
more weight, in this case, to the output after a delay Time (s)

Plucked string at 882 Hz


of 7. 1

0.8

• The difference equation for linear interpolation is

Amplitude
0.6

given by 0.4

0.2

ŷ(n − η) = (1 − η) · y(n) + η · y(n − 1) 0


0 0.5 1 1.5 2 2.5 3
Time (s)

where η is the desired fractional delay. Figure 12: Decay rate is faster at higher frequencies.

• The equivalent, but more-efficient, one-multiply


form is given by
ŷ(n − η) = y(n) + η · [y(n − 1) − y(n)] • This behaviour is generally desired, as it is a
characteristic of acoustic systems. But should it be so
extreme?
CMPT 889: Computational Modelling for Sound Synthesis: Delay 17 CMPT 889: Computational Modelling for Sound Synthesis: Delay 18

• PROBLEM: How does one control the decay rate so Selected Smith and Jaffe Extensions
as to obtain a note of desired duration?

• Tuning (fractional delay) using allpass filters as an


alternative to linear interpolation
• Decay rate shortening and stretching
• Dynamics
• Rests at the ends of notes (i.e. turning off the
algorithm without hearing a click)
• Glissandi and Slurs
• Sympathetic String Simulation

CMPT 889: Computational Modelling for Sound Synthesis: Delay 19 CMPT 889: Computational Modelling for Sound Synthesis: Delay 20
Tuning First-Order Allpass Filter

• For large N (low pitches) the difference between N


and N + 1 is slight, but becomes increasingly • The first-order allphass filter has transfer function
noticeable for small N (high pitches). C + z −1
Hc(z) ,
• Recall, the fundamental frequency (which is inversely 1 + Cz −1
proportional to the period) is given by where |C| < 1 for stability.
1 fs • The (unity) amplitude response is given by
f1 , =
(N + 1/2)Ts N + 1/2 |C + e−jωTs | C +1
Gc(f ) , |Hc(ejωTs )| = = = 1.
which may be expressed more generally in terms of |1 + Ce−jωTs | 1 + C
phase delay of our feedback filter:
• The phase delay (in seconds) is defined by minus
fs the complex angle of the frequency
f1 = .
N + Pa(f1) response divided by the radian frequency.
• We need to introduce a filter into the feedback loop • To express the phase delay in samples, furthur divide
that can contribute a small delay without alterning by the sampling period Ts:
the loop gain.
∠Hc(ejωTs )
• What kind of filters can introduce a Pc(f ) , − ,
ωTs
frequency-dependent delay without having an effect
where the final expression in the paper is obtained
on gain?
recalling that the angle of a complex number z is,
 
Im(z)
∠z , tan−1 − .
Re(z)
CMPT 889: Computational Modelling for Sound Synthesis: Delay 21 CMPT 889: Computational Modelling for Sound Synthesis: Delay 22

and that the angle of a ratio is equal to the difference Setting the Allpass Phase Delay to a
between the numerator and denominator angles Desired Frequency
a
∠ = ∠b − ∠a.
b
• The low-frequency phase delay may be approximated • Given a desired fundamental frequency f1, the
by corresponding period in samples is given by
1−C
Pc(f ) ≈ , P1 = fs/f1.
1+C
and the filter coefficient C may be solved as a • We then desire a model with phase delay (in samples)
function of the desired phase delay Pc(f ).
N + Pa(f1) + Pc(f1) = P1.
1 − Pc(f )
C≈ . where Pa(f1) = 1/2 for the two-point averager.
1 + Pc(f )
• The integer buffer length N becomes
N , Floor(P1 − Pa(f1) − ǫ),
where ǫ is a number much less than 1, that was used
to shift Pc(f1)’s one-sampe delay range above 0 to 1,
to eliminate possible instability caused by pole-zero
cancellation on the unit circle (at a delay of 0).
• The delay in samples becomes
Pc(f1) , P1 − N − Pa(f1).

CMPT 889: Computational Modelling for Sound Synthesis: Delay 23 CMPT 889: Computational Modelling for Sound Synthesis: Delay 24
Attenuation of “Harmonics” Decay Rate of “Harmonics”

• On each pass through the delay-line loop, a partial at • The time constant τ is the time to decay by 1/e.
frequency f is subject to an attenuation equal to the
• To solve τf , the time constant for frequency f , begin
loop amplitude response, which in this case is the
by equating the attenuation factor to the exponential
gain of the two-point averager:
function e−t/τf :
Ga(f ) = cos(πf Ts).
αf (t) = e−t/τf
• After M passes through the delay-line loop, a partial t
ln αf (t) = − (take log of both sides)
at frequency f is subject to attenuation cos(πf Ts)M . τf
• Since the round-trip time in the loop is N + 1/2 t (N + 1/2) Ts
τf = − =−
samples, the number of trips through the loop after n ln αf (t) ln cos(πf Ts)
samples (nTs seconds) is given by
n t/Ts tfs • The time constant (in seconds) per harmonic is given
M= = = = tf1. by
N + 1/2 N + 1/2 N + 1/2
where fs/(N + 1/2) = f 1. t
τk , −
ln αk (t)
• The attenuation factor at time t = nTs is then given t
by = −
ln cos(πfk Ts)tf1
αf (t) , cos(πf Ts)tf1 .
1
• That is, a partial or harmonic of frequency f, having = −
f1 ln cos(πfk Ts)
an initial amplitude of A at time 0, will have
amplitude Aαf (t) at time t seconds.
CMPT 889: Computational Modelling for Sound Synthesis: Delay 25 CMPT 889: Computational Modelling for Sound Synthesis: Delay 26

Attenuation and Decay with General Relating to the T60


Loss Filter

• For audio is more typical to define the time constant


• The filter accounting for frequency-dependent loss as the time it takes to decay -60dB, or 0.001 times
may be other than a two-point averager. It is the initial value.
therefore useful to present the attenuation and decay
• The attenuation factor at time t = t60(f ) is given by
more generally.
αf (t60(f )) = 0.001.
• The attenuation factor is given by
tfs • Conversion from τ to t60 is done by
αk (t) = Ga(fk ) N+Pa(fk )
0.001 = e−t60/τ
• And the decay for each harmonic becomes t60
ln(0.001) =
N + Pa(fk ) τ
τk = − t60 = − ln(0.001)τ
fs ln Ga(2πfk Ts)
≈ 6.91τ
where Ga(fk ) and Pa(fk ) are the gain and phase
delays, respectively, of the filter used.

CMPT 889: Computational Modelling for Sound Synthesis: Delay 27 CMPT 889: Computational Modelling for Sound Synthesis: Delay 28
Decay of non-harmonics Decay-time Shortening

• The previous analysis describes the attenuation due to • To shorten the decay time, a loss factor of ρ can be
“propagation” around the loop. introduced in the feedback loop, yielding
• Sinusoids that do not “fit” into the loop, i.e. are not yn−N + yn−(N +1)
yn = xn + ρ
integer multiples of the frequency whose period 2
exactly matches the loop length N + 1/2, are quicky • The amplitude envelope of a sinusoid at frequency f ,
destroyed by self interference. TODO: add matlab is now proportional to
figure.
αf (t, ρ) = |ρ cos(πf Ts)|f1t = |ρ|f1tαf (t).
• Though the loop is initialized with random numbers,
after a very short time the primary frequencies and the decay-time constant for the fundamental
remaining in the loop are those with an integer frequency becomes
number of periods in N + 1/2 samples. 1
τ1(ρ) = − .
f1 ln |ρ cos(πf1Ts)|
• Note that ρ cannot be used to lengthen the decay
time, since the amplitude at 0 Hz would increase
exponentially.
• |ρ| ≤ 1 if the string is to be stable.
• ρ is used to shorten the low-pitch notes.

CMPT 889: Computational Modelling for Sound Synthesis: Delay 29 CMPT 889: Computational Modelling for Sound Synthesis: Delay 30

Setting ρ for a desired t60 Decay Stretching

• For a desired t60, determine the corresponding time • To stretch the decay, and reduce the low at high
constant τ frequencies, the feedback average Ha can be changed
t60 t60 t60 to a two-point weighted average.
τ =− = ≈ .
ln(0.001) ln(1000) 6.91 Ha(z, S) = (1 − S) + Sz −1
• The time constant is given by where S, the stretching factor, is between 0 and 1.
1
τ = − • For stability, S can’t be greater than 1.
f1 ln(ρ cos(πf1T ))
1 • When S = 1/2, Ha(z, S) reduces the the previous
ln(ρ cos(πf1T )) = − two-point averager.
f1
τ 
1 • When S = 0 or 1, the frequency-dependent term
ρ cos(πf1T ) = exp −
f1 τ disappears, and the gain response is unity for all f.
−1/(f1τ )
e • At intermediate values, 0 < S < 1, the note duration
ρ = −
cos(πf1T ) is finite, with a minimum for S = 1/2.
• The resulting decay time is then a function of loss
factor ρ and stretch factor S.

CMPT 889: Computational Modelling for Sound Synthesis: Delay 31 CMPT 889: Computational Modelling for Sound Synthesis: Delay 32
Effect of Decay Stretching on Tuning Dynamics

• Changing S changes the effective loop length as a • Strings plucked hard have more energy in the higher
function of frequency since it changes the phase delay partials than string plucked lightly.
of the overall loop. • To simulate this dynamic difference in spectrum, the
• We must therefore compute Pa(f1) when using the bandwidth is controlled using a one-pole low-pass
Allpass filters to tune to the desired frequency. filter applied to the initial noise burst (before it is fed
• As shown in the paper, for low frequencies relative to into the string).
the sampling rate, we may use the approximation 1−R
Hd(z) , ,
1 − Rz −1
Pa(f, S) ≈ S, 0 ≤ S ≤ 1.
where R is a real number between 0 and 1, computed
• Again, for S = 1/2, we have the basic string as a funtion of fundamental frequency f1 and the
algorithms. desired dynamic level L.
• When a series of notes at pitch f1 is played while R is
moved gradually toward 1, a diminuendo is
approximated in terms of both decreasing loudness
and spectral bandwidth reduction.

CMPT 889: Computational Modelling for Sound Synthesis: Delay 33 CMPT 889: Computational Modelling for Sound Synthesis: Delay 34

Dynamic Level L Computing R for a given fundamental


and dynamic

• The dynamic level L is the bandwidth between 0 and 1. The one-pole lowpass filter having bandwidth L is
fs/2. given by
• If L is small, the spectrum is more lowpass filtered. 1 − RL
HL(z) , , RL , e−πLTs .
Large L gives a brighter spectrum corresponding to 1 − RLz −1
louder notes. 2. The gain at the reference frequency fm is
• For a given dynamic level L, R must be changed with 1 − RL
GL , |HL(ej2πfmTs )| =
pitch to yield uniform perceived loudness. A good |1 − RLe−j2πfmTs |
approximation is obtained by varying R so that the √
where fm = fufl is the geometric mean of the
amplitude of the fundamental f1 is constant. frequency range between fl and fu < fs/2.
• Steps for computing R for a given fundamental f1 and 3. The dynamics filter is a one-pole lowpass filter having
dynamic L: gain Gd(f1) = GL at any fundamental frequency f1,
1. Design a one-pole lowpass filter having bandwidth 1−R
GL = , where
L. |1 − Re−j2πf1 Ts |
2. Compute gain of the filter at the “middle” 1 − G2L cos(2πf1Ts)
frequency. R =
1 − G2L
3. Compute dynamics filter as a one-pole, lowpass p
1 − G2L cos2(πf1Ts)
filter having this gain at the desired fundamental ± 2GL sin(πf1Ts) ,
1 − G2L
f1 .
using the value < 1 in magnitude for stability.
CMPT 889: Computational Modelling for Sound Synthesis: Delay 35 CMPT 889: Computational Modelling for Sound Synthesis: Delay 36
Rests at the Ends of Notes Glissandi and Slurs

• The basic algorithms handles a player playing a second


note before the first dies away, since the discontinuity • A slur or glissando (changing pitch without
is perceived as a new note rather than a click. re-plucking) can be simulated by changing the order
of the filter without re-exciting it.
• If there is a rest after a note however, and the
algorithm is abruptly “turned off” by replacing with • This is when it becomes especially crucial to use
zeros, a discontinuity results that is heard as a click. fractional delay lines for tuning, so frequency sweeps
are perceived smoothly.
• Solution: the loss factor ρ used for decay shortening
is set to a relatively small value in the last few
milliseconds of the note:
– a ρ close to 1 simulates a string being damped
with soft material such as the finger,
– a smaller ρ simulates dampening with a hard
material such as a pick.
• It may be useful to compute ρ as a function of a
desired t60:
e−1/f τ t60
ρ(t60) = , τ, .
| cos(πf Ts)| ln(1000)
• Onset clicks may be eliminated using an exponential
or linear amplitude envelope.

CMPT 889: Computational Modelling for Sound Synthesis: Delay 37 CMPT 889: Computational Modelling for Sound Synthesis: Delay 38

Sympathetic String Simulation Tapped Delay Line

• Sympathetic vibrations of other strings, as well as


resonances of the instrument body, give each pitch • A tap refers to the extraction of the signal at a
individual character. certain position within the delay-line.
• The basic algorithm has homogeneity of character • The tap may be interpolating or non-interpolating,
throughout its pitch range. and also may be scaled.
• Solution 1: feed the output of the string into a body • A tap implements a shorter delay line within a larger
resonator (harder). one.
• Solution 2: excite a copy of the string simulator tuned x(n) z −M1 z −(M2 −M1 ) y(n) = x(n − M2 )
to a different pitch, by a small percentage of the b1
output of the (plucked) string.
b1x(n − M1 )
• The sympathetic string acts as a bank of very narrow Figure 13: A delay line tapped after a delay of M1 samples.
bandpass filters with center frequencies at the partial
frequencies of the string fundamental.
• All partials of the plucked string that do not coincide
with those of the sympathetic string will be highly
attenuated.
• Implementing multiple strings at multiple frequencies
may be done using a multi-tap delay line (such as is
used in reverberators or chorus effects).

CMPT 889: Computational Modelling for Sound Synthesis: Delay 39 CMPT 889: Computational Modelling for Sound Synthesis: Delay 40
Multip-Tap Delay Line Example Simulating Plucking Position

• In a string is plucked at a certain position, all


standing waves (and corresponding partial
• Multi-Tapped delay lines efficiently simulate multiple
frequencies) with a node at that point are eliminated.
echoes from the same source signal.
• This can be simulated using a feedforward comb filter
x(n) z −M1 z −(M2 −M1) z −(M3 −M2)

b0 b1 b2 b3
having difference equation
y(n) y(n) = x(n) − x(n − µN ),
Figure 14: A multi-tapped delay with length M3 .
where µ is the fraction of the string between the
• In the above figure, the total delay line length is M3 bridge and pluck point.
samples, and the internal taps are located at delays of • When µ = 1/2, the even harmonics are removed, and
M1 and M2 samples, respectively. the effect is similar to that of plucking a string at its
• The output signal is a linear combination of the input midpoint.
signal x(n), the delay-line output x(n − M3), and the • This will have the effect of introducing zeros
two tap signals x(n − M1) and x(n − M2). uniformely spaced over the spectrum of the noise
• The difference equation is given by burst.

y(n) = b0x(n)+b1x(n−M1)+b2x(n−M2)+b3x(n−M3)

• The corresponding transfer function is given by


H(z) = b0 + bM1 z −M1 + bM2 z −M2 + bM3 z −M3

CMPT 889: Computational Modelling for Sound Synthesis: Delay 41 CMPT 889: Computational Modelling for Sound Synthesis: Delay 42

Varying the Character of the Attacks

• The length of the noise burst can be used to change


the character of the attack:
– to give a more noisy attack, increase duration of
attack from tx = N Ts to some tx > N Ts.
– to subdue the attack, make 0 < tx < N Ts,
though for very small tx, the pluck illusion fades.
• Excite the string with a rich harmonic spectrum
rather than a noise spectrum, or perhaps a mixture of
the two (with amplitude not exceeding 1).
• Character can be changed by lowpass filtering the
noise burst pluck.
• Softening can be done by turn on the output of the
algorithms after some of the high-frequency energy
has dissipated.
• Two noise bursts separated by a short amount of time
can simulate multiple attacck of string tune in unison
(mandolin).

CMPT 889: Computational Modelling for Sound Synthesis: Delay 43

Das könnte Ihnen auch gefallen