Variable Delay Line Flanging

Variable Delay Line Flanging

Variable Delay Line MUS420 Lecture Time Varying Delay Effects static double A[N]; static double *rptr = A; // read ptr Julius O. Smith III ([email protected]) , Stefania Serafin, static double *wptr = A; // write ptr Jonathan S. Abel, and David P. Berners Center for Computer Research in Music and Acoustics (CCRMA) double setdelay(int M) { Department of Music, Stanford University Stanford, California 94305 rptr = wptr - M; while (rptr < A) { rptr += N; } June 27, 2020 } Outline double delayline(double x) { • Variable Delay Lines double y; *wptr++ = x; // A[wptr++] = x; • Flanging y = *rptr++; // y = A[rptr++]; • Phasing if ((wptr-A) >= N) { wptr -= N; } if ((rptr-A) >= N) { rptr -= N; } • Vibrato return y; • Doppler Effect and its simulation } • Chorus Effect Note separate read- and write-pointers • Modeling the Leslie Effect 1 2 Variable Delay Line Applications Flanging Variable delay lines are used for Perhaps the simplest time-varying delay effect: • Phasing • Used since the 1960s • Flanging • Two identical tape machines mixed equally: • Chorus • Leslie Flange • Reverb In digital waveguide synthesis, variable delay lines are used for • Vibrating strings (guitars, violins, ...) • Woodwind bores • Horns • Tonal percussion (rods, membranes) y(n) • Touch the flange of one of the supply reels, slowing it • Touch the flange of the other supply reel to slow it • Repeat, creating an oscillating variable delay • Keep the maximum delay below 10 ms or so • Sound Examples1 1http://en.wikipedia.org/wiki/Flanging 3 4 Flanging Model Feed-Forward Comb-Filter Amplitude Response Model = Feedforward comb filter with variable delay M: Recall: a) 2 g 1.5 x(n) M(n) samples of delay y(n) (depth) 1 y(n)= x(n)+ gx[n − M(n)] Magnitude (Linear) 0.5 0 • g = “depth” of the flanging effect 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Normalized Frequency (cycles per sample) • M(n)= length of the delay-line at time n b) 10 • M(n) typically triangular or sinusoidal 5 • Delay length is modulated by an “LFO” 0 −5 • Smooth delay variation demands interpolation −10 g=0.1 Magnitude (dB) g=0.5 −15 g=0.9 −20 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Normalized Frequency (cycles per sample) • Linear (top) and decibel (bottom) amplitude scales • H(z)=1+ gz−M – M =5 – g =0.1, 0.5, 0.9 5 6 • G(ω) =∆ H(ejωT ) = 1+ ge−jMωT → Summary of Flanging 2cos(MωT/ 2) when g =1 A flanger provides uniformly spaced notches and/or • In flangers, these nulls slowly move with time peaks in the frequency response that move over time “Basilar membrane comb massage” For g > 0, there are M peaks in the frequency response, centered about frequencies Drawbacks to Flanging: 2π ω(p) = k , k =0, 1, 2,...,M − 1. • Uniform notches can zero a periodic signal k M • Uniform peaks can impose “resonant pitch” For g =1 (maximum “flanging depth”), the peaks are (sounds like being inside a resonant tube) maximally pronounced, with M notches occurring (n) (p) • Exponentially spaced notches between them at frequencies ωk = ωk + π/M. (uniformly spaced on a log frequency scale) Notch spacing is inversely proportional to delay-line would be more uniform perceptually length 7 8 Phasing Four First-Order Analog Allpass Filters Phasers typically use nonuniformly spaced notches made First−Order Analog Allpass Phase Responses using a series chain of allpass filters: 3 2.5 fc=100 fc=200 2 g1 g2 g3 g4 fc=400 x(n) AP1 AP1 AP1 AP1 y(n) 1.5 fc=800 Phase − rad 1 g 0.5 0 2 3 4 See for example the Univibe2 10 10 10 Overall Phaser Amplitude Responses 0 First-Order Allpass Filter Section −10 Analog Transfer Function: −20 Magnitude (dB) ωb ∆ s − ωb −30 AP1 = . s + ωb −40 1 2 3 4 10 10 10 10 Digital Transfer Function: Frequency (Hz) −1 (a) Phase reponses of first-order analog allpass sections gi ∆ gi + z AP1 = −1. with Θ(ωT )= π/2 frequencies at 100, 200, 400, and 800 1+ giz Hz. (b) Corresponding phaser amplitude response. In practical operation, the π/2 frequencies change dynamically, usually periodically at some rate. 2http://www.geofex.com/Article_Folders/univibe/uvfrindx.htm 9 10 Vibrato Simulation Doppler Effect Vibrato can be simulated approximately using a Doppler Visualization by Daniel Russel at Kettering modulated delay line University3 A time-varying delay line can be interpreted as a Doppler-shift simulator due to motion of the listener • The Doppler effect causes the pitch of a sound source relative to the source. to appear to rise or fall due to motion of the source and/or listener relative to each other. • Recall the sound of a passing horn • Pitch is higher when source moves toward you • Pitch is lower when source moves away from you • Doppler shift is significant in the “Leslie effect” 3http://paws.kettering.edu/~drussell/Demos/doppler/doppler.html 11 12 Doppler Shift Formula Vector Formulation The Doppler shift is given by Let 1+ vls c • v (t)= sound-source velocity as a function of time t ωl = ωs vs,l s 1 − c • vl(t)= velocity of the listener, if any where • xs(t)= position of source • ωs = radian frequency emitted by the source at rest • xl(t)= position of listener • ωl = frequency received by the listener ∆ T • x =(x1,x2,x3) is 3D position • vls = speed of the listener relative to the propagation medium We have velocity related to position by in the direction of the source d d vs = xs(t) vl = xl(t). • vs,l = speed of the source dt dt relative to the propagation medium Consider a Fourier component of the source at frequency in the direction of the listener ωs. We wish to know how this frequency is shifted to ωl at the listener due to the Doppler effect. • c = sound speed Note that all quantities in this formula are scalars (not vectors) 13 14 Velocity Projection Doppler Simulation The Doppler effect depends only on velocity components Consider Doppler shift from a physical point of view: along the line connecting the source and listener. magnetic tape We may therefore orthogonally project the source and • Air analogous to a moving from source to listener at speed c listener velocities onto the vector xsl = xl − xs pointing from the source to the listener. • Source is analogous to the write-head of a tape recorder • Listener corresponds to the read-head • When either head moves, a Doppler shift is heard θs xl =(rl, 0) 0 Source Listener xsl = xl − xs vsl vs vl Write Read xs vs . Relevant geometry for a rotating horn Magnetic Tape c Projected source velocity: hvs,xsli hvs,xl − xsi vsl = Pxsl(vs) = 2 xsl = 2 (xl − xs) k xsl k k xl − xs k hvs,xli ≈ 2 xl = Pxl(vs) in far field (k xl k ≫ k xs k) k xl k 15 16 Doppler Simulation via Delay Lines Multiple Read/Write Pointers Source 1 Source 2 Source 3 Misc. Refinements: Interpolating Writes • Using multiple read pointers, multiple moving 0 Delay Line (plane-wave medium) . listeners are simulated Interpolating Reads c • Each read-pointer signal can be filtered to simulate propagation losses and radiation characteristics of the Listener 1 Listener 2 source in the direction of the listener The magnetic tape is now the delay line: • Read-pointers can move independently to simulate the different Doppler shifts associated with different • Tape read-head → delay-line read-pointer listener motions and relative source directions. • Tape write-head → delay-line write-pointer • Using multiple write pointers, multiple moving sources • Listener motion away from the source at speed vls are simulated corresponds to advancing the read-pointer by • Watch out for aliasing due to upward Doppler shift 1+ vls/c (thereby requiring interpolated reads) • Changing the write-pointer increment from 1 to 1+ vs,l/c corresponds source motion toward the listener at speed vs,l (thereby requiring interpolating writes into the delay memory) • Recall that interpolating writes are formally the graph-theoretic transpose of interpolating reads (ordinary “interpolation”) 17 18 Stereo Multiple-Moving-Source Simulation • These filter outputs sum into the delay lines at arbitrary (time-varying) locations using interpolating writes (de-interpolation) 0 Delay Line Left Out • The zero signals entering each delay line on the left n n n H( ) H( ) H( ) can be omitted if the left-most filter overwrites delay 2L 1L 0L memory instead of summing into it. H H H Source In 2 1 0 (n) (n) n n n • The outputs of H (z) and H (z) correspond to H( ) H( ) H( ) 0L 0R 2R 1R 0R the “direct signal” from the moving source, when a direct signal exists 0 Delay Line Right Out • These filters may incorporate modulation of losses due to the changing propagation distance from the moving • Input and output signals are on the right source to each listener, and they may include dynamic • Only one input source is shown equalization corresponding to the changing radiation • Additional input sources are handled identically, strength in different directions from the moving (and summing into the same delay lines in the same way. possibly turning) source toward each listener. (n) (n) • Source signal first passes through filter H0(z), which • The next trio of filters, H1(z), H1L (z), and H1R (z), provides time-invariant filtering common to all correspond to the next-to-shortest acoustic propagation paths. propagation path, typically the “first reflection,” such (n) (n) as from a wall close to the source.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    9 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us