ELEN E4896 MUSIC SIGNAL PROCESSING Lecture 2: Acoustics 1. Acoustics, Sound & the Wave Equation 2. Musical Oscillations 3. The Digital Waveguide Dan Ellis Dept. Electrical Engineering, Columbia University dpwe@ee.columbia.edu E4896 Music Signal Processing (Dan Ellis) http://www.ee.columbia.edu/~dpwe/e4896/ 2013-01-28 - 1 /16 1. Acoustics & Sound • Acoustics is the study of physical waves • Waves transfer energy without permanent displacement of matter • Common math for different media gas, liquid, solid, EM • Intuition: Pulse going down a rope E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 2 /16 The Wave Equation • For 1-D medium with displacement y(x, t): 2 c curvature 2 y = x2 2 y t2 acceleration simple to derive from freshman physics... y y(0,t) = m(t) y+(x,t) E4896 Music Signal Processing (Dan Ellis) x y(L,t) = 0 2013-01-28 - 3 /16 The Wave Equation 2 c • Solution: 2 y = 2 x y(x, t) = y + (x 2 y t2 ct) + y (x + ct) + y and rightward-moving y sum of leftward-moving traveling waves shape does not change (set by initial conditions) y+ c y y- c y(x,t) = y+ + yx E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 4 /16 Terminations & Reflections • Boundary conditions include fixed points e.g. held ends of string • Superposition of traveling waves must match constraints y+ y(x,t) = y+ + y– hence reflections • Any impedance change y– results in some reflection x=L energy loss... http://www.youtube.com/watch?v=YOi8suJTwx8#t=1m35s E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 5 /16 1-D Waveguides • Plucked/struck string tension S mass/length ε guitar, piano ... L • Acoustic tube π2 S 2 ω = 2 L ε pressure e.g. clarinet or trumpet vocal tract • Solid bar x xylophone, ... E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 6 /16 2. Musical Oscillations • (Pseudo) periodic oscillation is central to musical pitch Frequency 4000 3000 2000 1000 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time • Musical instruments create pitch in different ways... E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 7 /16 Simple Harmonic Motion • Basic 2nd order mechanical oscillation ẍ = 2 x x = A cos( t + ) resonance • Spring + mass + damper e.g. tuning fork F = kx m ω2 = ζ x k m • Not great as a musical instrument only fundamental E4896 Music Signal Processing (Dan Ellis) low amplitude 2013-01-28 - 8 /16 Relaxation Oscillator • Alternating states ‘closed state’ collects energy from steady source ‘open state’ releases energy, then reverts to closed • e.g.Vocal folds p u • Oscillation period depends on tension easy to adjust hard to keep stable E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 9 /16 Strings • Canonical wave equation example tension S mass/length ε L π2 S 2 ω = 2 L ε guitar (plucked) piano (struck) violin (bowed ...) • Control of period vary length L (frets) vary tension S and/or length L (piano) • Initial conditions = excitation E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 10/16 Air Column • Wave equation in air U0 ejωt kx = π x=λ/2 pressure = 0 (node) vol.veloc. = max (antinode) pressure waves traveling in tube resonance of tube depends on length coupled energy input • Clarinet, oboe, organ, flute finger holes disrupt waveguide (scattering) first reflection determines oscillation period E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 11/16 3. Digital Waveguides • 1-D waveguide is easily discretized spatial sampling Julius Smith, 1992... time sampling nonlinear element scattering junction (tonehole) energy acoustic waveguide ω= πc 2L (quarter wavelength) waveguide ➝ delay line scattering ➝ low-pass feedback final load ➝ instrument body resonances nonlinear function for energy input https://ccrma.stanford.edu/~jos/wg.html E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 12/16 Digital Waveguides • Direct physical model + simplifications Nut -1 Initialize with pluck shape -1 y+(0,t) = –y-(0,t) KarplusStrong Bridge dispersion + radiation load String Waveguide y+(x,t) Delay Lines y-(x,t) hreflec y-(L,t) = hreflec(t) * y+(L,t) Delay z-L Initialize with random values s(t) s(t) L = SR/f0 hLP E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 13/16 Waveguide Simulation • Karplus-Strong Plucked String algorithm Initialize with random values Delay z-L L = SR/f0 Lowpass • Direct implementation of traveling waves E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 14/16 Karplus-Strong in Pd • Pd’s delwrite~ / delread~ implement the delay line http://blog.loomer.co.uk/2010/02/karplus-strong-guitar-string-synthesis.html E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 15/16 Summary • Wave equation: Simple physics leads to oscillations • Musical acoustics: Different ways to control steady tones • Digital waveguides: Natural, efficient simulation of tones E4896 Music Signal Processing (Dan Ellis) 2013-01-28 - 16/16