ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic...

16
E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16 Lecture 2: Acoustics Dan Ellis Dept. Electrical Engineering, Columbia University [email protected] http://www.ee.columbia.edu/~dpwe/e4896/ 1 1. Acoustics, Sound & the Wave Equation 2. Musical Oscillations 3. The Digital Waveguide ELEN E4896 MUSIC SIGNAL PROCESSING

Transcript of ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic...

Page 1: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

Lecture 2:Acoustics

Dan EllisDept. Electrical Engineering, Columbia University

[email protected] http://www.ee.columbia.edu/~dpwe/e4896/1

1. Acoustics, Sound & the Wave Equation2. Musical Oscillations3. The Digital Waveguide

ELEN E4896 MUSIC SIGNAL PROCESSING

Page 2: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

1. Acoustics & Sound• Acoustics is the study of physical waves

• Waves transfer energy without permanent displacement of matter

• Common math for different mediagas, liquid, solid, EM

• Intuition: Pulse going down a rope

2

Page 3: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

The Wave Equation• For 1-D medium with displacement :

simple to derive from freshman physics...

3

c2 �2y

�x2=

�2y

�t2

y(x, t)

curvature acceleration

x

y

y(0,t) = m(t)

y+(x,t) y(L,t) = 0

Page 4: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

The Wave Equation

• Solution:

sum of leftward-moving and rightward-movingtraveling wavesshape does not change (set by initial conditions)

4

y(x, t) = y+(x� ct) + y�(x + ct)y+ y�

y

x

y+

y-

y(x,t)= y++y-

c

c

c2 �2y

�x2=

�2y

�t2

Page 5: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

Terminations & Reflections• Boundary conditions include fixed points

e.g. held ends of string

• Superposition of traveling waves must match constraintshence reflections

• Any impedance changeresults in some reflection

5

x = L

y(x,t)= y+ + y–

y+

y–

http://www.youtube.com/watch?v=YOi8suJTwx8#t=1m35s

energy loss...

Page 6: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

1-D Waveguides• Plucked/struck string

guitar, piano ...

• Acoustic tubee.g. clarinet or trumpetvocal tract

• Solid barxylophone, ...

6

L

tension S mass/length ε

ω2 = π2 S

L2 ε

x

pressure

Page 7: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

2. Musical Oscillations• (Pseudo) periodic oscillation

is central to musical pitch

• Musical instruments create pitch in different ways...

7

Time

Frequency

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50

1000

2000

3000

4000

Page 8: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

Simple Harmonic Motion• Basic 2nd order mechanical oscillation

resonance

• Spring + mass + dampere.g. tuning fork

• Not great as a musical instrumentonly fundamental ⇒ low amplitude

8

x = ��2x x = A cos(�t + �)

m

x

F = kx

ζ ω2 = k m

Page 9: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

Relaxation Oscillator• Alternating states

‘closed state’ collects energy from steady source‘open state’ releases energy, then reverts to closed

• e.g. Vocal folds

• Oscillation period depends on tensioneasy to adjusthard to keep stable

9

p u

Page 10: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

Strings• Canonical wave equation example

guitar (plucked)piano (struck)violin (bowed ...)

• Control of periodvary length L (frets)vary tension S and/or length L (piano)

• Initial conditions = excitation

10

L

tension S mass/length ε

ω2 = π2 S

L2 ε

Page 11: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

Air Column• Wave equation in air

pressure waves traveling in tuberesonance of tube depends on lengthcoupled energy input

• Clarinet, oboe, organ, flutefinger holes disrupt waveguide (scattering)first reflection determines oscillation period

11

U0 ejωt

kx = π x = λ / 2

pressure = 0 (node) vol.veloc. = max

(antinode)

Page 12: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

3. Digital Waveguides• 1-D waveguide is easily discretized

spatial sampling ⇔ time sampling

waveguide ➝ delay linescattering ➝ low-pass feedbackfinal load ➝ instrument body resonancesnonlinear function for energy inputhttps://ccrma.stanford.edu/~jos/wg.html

12

energy

nonlinear element

scattering junction (tonehole)

(quarter wavelength)

acoustic waveguide

ω = π c 2 L

Julius Smith, 1992...

Page 13: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

Digital Waveguides• Direct physical model + simplifications

13

Delay z-L

L = SR/f0Initialize with random values

Initialize with pluck shape

Delay Lines

y+(x,t)

y-(x,t)

-1

-1

y+(0,t) = –y-(0,t)

y-(L,t) = hreflec(t) * y+(L,t)

s(t)

s(t)

hLP

hreflec

String WaveguideNut Bridge dispersion+ radiation load

Karplus-Strong

Page 14: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

Waveguide Simulation• Karplus-Strong Plucked String algorithm

• Direct implementation of traveling waves

14

Delay z-L

L = SR/f0Lowpass

Initialize with random values

Page 15: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

Karplus-Strong in Pd• Pd’s delwrite~ / delread~ implement the

delay line

15

http://blog.loomer.co.uk/2010/02/karplus-strong-guitar-string-synthesis.html

Page 16: ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: …E4896 Music Signal Processing ... acoustic waveguide ω = π c 2 L ... dpwe/e4896/lectures/E4896-L02.pdf · 2013-2-4

E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - /16

Summary• Wave equation:

Simple physics leads to oscillations

• Musical acoustics:Different ways to control steady tones

• Digital waveguides:Natural, efficient simulation of tones

16