MUS420 Lecture Time Varying Delay Effects

Similar documents
FIR/Convolution. Visulalizing the convolution sum. Convolution

CMPT 468: Delay Effects

FIR/Convolution. Visulalizing the convolution sum. Frequency-Domain (Fast) Convolution

Flanger. Fractional Delay using Linear Interpolation. Flange Comb Filter Parameters. Music 206: Delay and Digital Filters II

Linear Frequency Modulation (FM) Chirp Signal. Chirp Signal cont. CMPT 468: Lecture 7 Frequency Modulation (FM) Synthesis

Physics 132 Quiz # 23

In this app note we will explore the topic of modeling a physical device using DSP techniques.

CMPT 468: Frequency Modulation (FM) Synthesis

Resonator Factoring. Julius Smith and Nelson Lee

DESC9115 Written Review 2: Digital Implementation of a Leslie Speaker Effect. Digital Audio Systems: DESC9115, Semester

Structure of Speech. Physical acoustics Time-domain representation Frequency domain representation Sound shaping

SECTION A Waves and Sound

Spectrum. Additive Synthesis. Additive Synthesis Caveat. Music 270a: Modulation

Laboratory Assignment 4. Fourier Sound Synthesis

SECTION A Waves and Sound

Antenna Engineering Lecture 3: Basic Antenna Parameters

Music 270a: Modulation

Convention Paper Presented at the 125th Convention 2008 October 2 5 San Francisco, CA, USA

Lecture Summary Chapter 2 Summation

Class Overview. tracking mixing mastering encoding. Figure 1: Audio Production Process

Signal Processing Libraries for FAUST

Chapter 17 Waves in Two and Three Dimensions

b) (4) How large is the effective spring constant associated with the oscillations, in N/m?

WARPED FILTER DESIGN FOR THE BODY MODELING AND SOUND SYNTHESIS OF STRING INSTRUMENTS

AUDIO EfFECTS. Theory, Implementation. and Application. Andrew P. MePkerson. Joshua I. Relss

UNIT Explain the radiation from two-wire. Ans: Radiation from Two wire

MUS421/EE367B Applications Lecture 9C: Time Scale Modification (TSM) and Frequency Scaling/Shifting

y(n)= Aa n u(n)+bu(n) b m sin(2πmt)= b 1 sin(2πt)+b 2 sin(4πt)+b 3 sin(6πt)+ m=1 x(t)= x = 2 ( b b b b

KULLIYYAH OF ENGINEERING

CSC475 Music Information Retrieval

4.5 Fractional Delay Operations with Allpass Filters

Laboratory Assignment 2 Signal Sampling, Manipulation, and Playback

Music 171: Sinusoids. Tamara Smyth, Department of Music, University of California, San Diego (UCSD) January 10, 2019

Sound is the human ear s perceived effect of pressure changes in the ambient air. Sound can be modeled as a function of time.

PHYS102 Previous Exam Problems. Sound Waves. If the speed of sound in air is not given in the problem, take it as 343 m/s.

Signals A Preliminary Discussion EE442 Analog & Digital Communication Systems Lecture 2

Chapter 16. Waves and Sound

Introduction to signals and systems

No Brain Too Small PHYSICS

THE PATTERNS OF THE SOUND INTENSITY DISTRIBUTION OF MIDRANGE LOUDSPEAKER

Week 1. Signals & Systems for Speech & Hearing. Sound is a SIGNAL 3. You may find this course demanding! How to get through it:

Section 1 Sound Waves. Chapter 12. Sound Waves. Copyright by Holt, Rinehart and Winston. All rights reserved.

INTRODUCTION TO COMPUTER MUSIC PHYSICAL MODELS. Professor of Computer Science, Art, and Music. Copyright by Roger B.

Audio Engineering Society. Convention Paper. Presented at the 115th Convention 2003 October New York, New York

Lecture 17 z-transforms 2

WAVE MOTION. Challenging MCQ questions by The Physics Cafe. Compiled and selected by The Physics Cafe

Circuit Analysis-II. Circuit Analysis-II Lecture # 2 Wednesday 28 th Mar, 18

Chapter 12. Preview. Objectives The Production of Sound Waves Frequency of Sound Waves The Doppler Effect. Section 1 Sound Waves

Waves and Sound Practice Test 43 points total Free- response part: [27 points]

Auditory Localization

Directionality. Many hearing impaired people have great difficulty

ECE 185 ELECTRO-OPTIC MODULATION OF LIGHT

Physics I Notes: Chapter 13 Sound

#8A RLC Circuits: Free Oscillations

Signal Processing. Introduction

Channel. Muhammad Ali Jinnah University, Islamabad Campus, Pakistan. Multi-Path Fading. Dr. Noor M Khan EE, MAJU

Investigating Electromagnetic and Acoustic Properties of Loudspeakers Using Phase Sensitive Equipment

SOPA version 2. Revised July SOPA project. September 21, Introduction 2. 2 Basic concept 3. 3 Capturing spatial audio 4

Real-Time Scanning Goniometric Radiometer for Rapid Characterization of Laser Diodes and VCSELs

Synthesis Techniques. Juan P Bello

SAMPLING THEORY. Representing continuous signals with discrete numbers

A mechanical wave is a disturbance which propagates through a medium with little or no net displacement of the particles of the medium.

EE42: Running Checklist of Electronics Terms Dick White

Direction-Dependent Physical Modeling of Musical Instruments

Final Exam Practice Questions for Music 421, with Solutions

describe sound as the transmission of energy via longitudinal pressure waves;

Multi-Path Fading Channel

EECS 216 Winter 2008 Lab 2: FM Detector Part I: Intro & Pre-lab Assignment

Laboratory Assignment 5 Amplitude Modulation

DREAM DSP LIBRARY. All images property of DREAM.

Additional Reference Document

Lecture on Angular Vibration Measurements Based on Phase Demodulation

Resonant Self-Destruction

Applications of Passivity Theory to the Active Control of Acoustic Musical Instruments

Dept. of Computer Science, University of Copenhagen Universitetsparken 1, DK-2100 Copenhagen Ø, Denmark

Sound Waves Practice Problems PSI AP Physics 1. (D) It cannot be determined with the given information.

Lab 9 Fourier Synthesis and Analysis

ENSEMBLE String Synthesizer

Creating a Virtual Cello Music 421 Final Project. Peder Larson

EC Transmission Lines And Waveguides

MODELING AND MEASUREMENT OF WIND INSTRUMENT BORES

EXPERIMENT 4: RC, RL and RD CIRCUITs

Continuous Arrays Page 1. Continuous Arrays. 1 One-dimensional Continuous Arrays. Figure 1: Continuous array N 1 AF = I m e jkz cos θ (1) m=0

Chapter 33. Alternating Current Circuits

Lab 2: Capacitors. Integrator and Differentiator Circuits

EXPERIMENT 4: RC, RL and RD CIRCUITs

IMPULSE RESPONSE MEASUREMENT WITH SINE SWEEPS AND AMPLITUDE MODULATION SCHEMES. Q. Meng, D. Sen, S. Wang and L. Hayes

INTRODUCTION TO COMPUTER MUSIC SAMPLING SYNTHESIS AND FILTERS. Professor of Computer Science, Art, and Music

AP Physics C. Alternating Current. Chapter Problems. Sources of Alternating EMF

Lecture 3 Complex Exponential Signals

Adaptive Systems Homework Assignment 3

Muhammad Ali Jinnah University, Islamabad Campus, Pakistan. Fading Channel. Base Station

Sound. Production of Sound

NAME STUDENT # ELEC 484 Audio Signal Processing. Midterm Exam July Listening test

Sampling and Reconstruction of Analog Signals

The University of Texas at Austin Dept. of Electrical and Computer Engineering Final Exam

Copyright 2009 Pearson Education, Inc.

6.014 Lecture 14: Microwave Communications and Radar

Date Period Name. Write the term that corresponds to the description. Use each term once. beat

An Effective Model of BucketBrigade Device-Based Audio. Circuits. Colin Raffel CCRMA DSP Seminar May 7th, 2010

Transcription:

MUS420 Lecture Time Varying Delay Effects Julius O. Smith III (jos@ccrma.stanford.edu), Stefania Serafin, Jonathan S. Abel, and David P. Berners Center for Computer Research in Music and Acoustics (CCRMA) Department of Music, Stanford University Stanford, California 94305 February 5, 2019 Outline Variable Delay Lines Flanging Phasing Vibrato Doppler Effect and its simulation Chorus Effect Modeling the Leslie Effect 1

Variable Delay Line static double A[N]; static double *rptr = A; // read ptr static double *wptr = A; // write ptr double setdelay(int M) { rptr = wptr - M; while (rptr < A) { rptr += N; } } double delayline(double x) { double y; *wptr++ = x; // A[wptr++] = x; y = *rptr++; // y = A[rptr++]; if ((wptr-a) >= N) { wptr -= N; } if ((rptr-a) >= N) { rptr -= N; } return y; } Note separate read- and write-pointers 2

Variable Delay Line Applications Variable delay lines are used for Phasing Flanging Chorus Leslie Reverb In digital waveguide synthesis, variable delay lines are used for Vibrating strings (guitars, violins,...) Woodwind bores Horns Tonal percussion (rods, membranes) 3

Flanging Perhaps the simplest time-varying delay effect: Used since the 1960s Two identical tape machines mixed equally: Flange 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 Examples 1 1 http://en.wikipedia.org/wiki/flanging 4

Flanging Model Model = Feedforward comb filter with variable delay M: x(n) M(n) samples of delay g (depth) y(n) y(n) = x(n)+gx[n M(n)] g = depth of the flanging effect M(n) = length of the delay-line at time n M(n) typically triangular or sinusoidal Delay length is modulated by an LFO Smooth delay variation demands interpolation 5

Feed-Forward Comb-Filter Amplitude Response Recall: a) 2 Magnitude (Linear) 1.5 1 0.5 0 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) b) 10 Magnitude (db) 5 0 5 10 15 g=0.1 g=0.5 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 6

G(ω) = H(e jωt ) = 1+ge jmωt 2cos(MωT/2) when g = 1 In flangers, these nulls slowly move with time For g > 0, there are M peaks in the frequency response, centered about frequencies ω (p) k = k 2π, k = 0,1,2,...,M 1. M For g = 1 (maximum flanging depth ), the peaks are maximally pronounced, with M notches occurring between them at frequencies ω (n) k = ω (p) k +π/m. Notch spacing is inversely proportional to delay-line length 7

Summary of Flanging A flanger provides uniformly spaced notches and/or peaks in the frequency response that move over time Basilar membrane comb massage Drawbacks to Flanging: Uniform notches can zero a periodic signal Uniform peaks can impose resonant pitch (sounds like being inside a resonant tube) Exponentially spaced notches (uniformly spaced on a log frequency scale) would be more uniform perceptually 8

Phasing Phasers typically use nonuniformly spaced notches made using a series chain of allpass filters: x(n) AP g 1 1 AP g 2 1 AP g 3 1 AP g 4 1 y(n) See for example the Univibe 2 g First-Order Allpass Filter Section Analog Transfer Function: AP ω b 1 Digital Transfer Function: AP g i 1 = s ω b s+ω b. = g i+z 1 1+g i z 1. 2 http://www.geofex.com/article_folders/univibe/uvfrindx.htm 9

Four First-Order Analog Allpass Filters Phase rad 3 2.5 2 1.5 1 0.5 First Order Analog Allpass Phase Responses fc=100 fc=200 fc=400 fc=800 0 10 2 10 3 10 4 0 Overall Phaser Amplitude Responses Magnitude (db) 10 20 30 40 10 1 10 2 10 3 10 4 Frequency (Hz) (a) Phase reponses of first-order analog allpass sections with Θ(ωT) = π/2 frequencies at 100, 200, 400, and 800 Hz. (b) Corresponding phaser amplitude response. In practical operation, the π/2 frequencies change dynamically, usually periodically at some rate. 10

Vibrato Simulation Vibrato can be simulated approximately using a modulated delay line A time-varying delay line can be interpreted as a Doppler-shift simulator due to motion of the listener relative to the source. 11

Doppler Effect Doppler Visualization by Daniel Russel at Kettering University 3 The Doppler effect causes the pitch of a sound 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 3 http://paws.kettering.edu/~drussell/demos/doppler/doppler.html 12

Doppler Shift Formula The Doppler shift is given by where 1+ v ls ω l = ω c s 1 v s,l c ω s = radian frequency emitted by the source at rest ω l = frequency received by the listener v ls = speed of the listener relative to the propagation medium in the direction of the source v s,l = speed of the source relative to the propagation medium in the direction of the listener c = sound speed Note that all quantities in this formula are scalars (not vectors) 13

Vector Formulation Let v s (t) = sound-source velocity as a function of time t v l (t) = velocity of the listener, if any x s (t) = position of source x l (t) = position of listener x = (x 1,x 2,x 3 ) T is 3D position We have velocity related to position by v s = d dt x s(t) v l = d dt x l(t). Consider a Fourier component of the source at frequency ω s. We wish to know how this frequency is shifted to ω l at the listener due to the Doppler effect. 14

Velocity Projection The Doppler effect depends only on velocity components along the line connecting the source and listener. We may therefore orthogonally project the source and listener velocities onto the vector x sl = x l x s pointing from the source to the listener. θ s x l = (r l,0) 0 x sl = x l x s v sl x s v s Relevant geometry for a rotating horn Projected source velocity: v sl = P xsl (v s ) = v s,x sl x sl 2 x sl = v s,x l x s x l x s 2 (x l x s ) v s,x l x l 2 x l = P xl (v s ) in far field ( x l x s ) 15

Doppler Simulation Consider Doppler shift from a physical point of view: Air analogous to a magnetic tape moving from source to listener at speed c 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 Source Listener Write v s Read...... Magnetic Tape c v l 16

Doppler Simulation via Delay Lines Source 1 Source 2 Source 3 Interpolating Writes 0 Delay Line (plane-wave medium) Interpolating Reads c... Listener 1 Listener 2 The magnetic tape is now the delay line: Tape read-head delay-line read-pointer Tape write-head delay-line write-pointer Listener motion away from the source at speed v ls corresponds to advancing the read-pointer by 1+v ls /c (thereby requiring interpolated reads) Changing the write-pointer increment from 1 to 1+v s,l /c corresponds source motion toward the listener at speed v s,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

Multiple Read/Write Pointers Misc. Refinements: Using multiple read pointers, multiple moving listeners are simulated Each read-pointer signal can be filtered to simulate propagation losses and radiation characteristics of the source in the direction of the listener Read-pointers can move independently to simulate the different Doppler shifts associated with different listener motions and relative source directions. Using multiple write pointers, multiple moving sources are simulated Watch out for aliasing due to upward Doppler shift 18

Stereo Multiple-Moving-Source Simulation 0 Delay Line Left Out H (n) 2L H (n) 1L H (n) 0L... H 2 H 1 H 0 Source In H (n) 2R H (n) 1R H (n) 0R 0 Delay Line Right Out Input and output signals are on the right Only one input source is shown Additional input sources are handled identically, summing into the same delay lines in the same way. Source signal first passes through filter H 0 (z), which provides time-invariant filtering common to all propagation paths. Left- and right-channel filters H (n) 0L (z) and H(n) 0R (z) are typically low-order, linear, time-varying filters implementing the time-varying characteristics of the shortest (time-varying) propagation path from the source to each listener. 19

These filter outputs sum into the delay lines at arbitrary (time-varying) locations using interpolating writes (de-interpolation) The zero signals entering each delay line on the left can be omitted if the left-most filter overwrites delay memory instead of summing into it. The outputs of H (n) 0L (z) and H(n) 0R (z) correspond to the direct signal from the moving source, when a direct signal exists These filters may incorporate modulation of losses due to the changing propagation distance from the moving source to each listener, and they may include dynamic equalization corresponding to the changing radiation strength in different directions from the moving (and possibly turning) source toward each listener. The next trio of filters, H 1 (z), H (n) 1L (z), and H(n) 1R (z), correspond to the next-to-shortest acoustic propagation path, typically the first reflection, such as from a wall close to the source. Since a reflection path is longer than the direct path, and since a reflection itself can attenuate (or scatter) an incident sound ray, there is generally more filtering required relative to the direct signal. This additional 20

filtering can be decomposed into its fixed component H 1 (z) and time-varying components H (n) 1L (z) and H (n) 1R (z). Note that acceptable results may be obtained without implementing all of the filters indicated. Furthermore, it can be convenient to incorporate H i (z) into (z) and H(n) ir their orders significantly. H (n) il The source-filters H (n) il (z) when doing so does not increase (z) and H(n) ir (z) may include HRTF filtering in order to impart illusory angles of arrival in 3D space. 21

Chorus Effect The chorus effect (or choralizer ) makes one sound source (such as a voice) sound like many singing (or playing) in unison Since performance in unison is never exact, chorus effects simulate this by making independently modified copies of the input signal Modifications include (1) delay (2) frequency shift (3) amplitude modulation Typical implementations use several time-varying delay lines for (1) and (2) Multipath filtering and reverb provide (3) indirectly Before digital delay lines, analog LC ladder networks were used (e.g., in the Hammond organ) An efficient chorus-effect implementation may be based on multiple interpolating taps working on a single delay line Each tap should be individually spatialized 22

The Leslie Leslie cabinet The Leslie, invented by Don Leslie, is typically used to choralize electronic organs and other instruments See the Leslie Wikipedia page 4 for an introduction. (Stereo sound example just under the first picture best heard in headphones.) Primarily a rotating horn and rotating speaker port The listener hears multiple cabinet reflections at different Doppler shifts, giving a kind of chorus effect 4 http://en.wikipedia.org/wiki/leslie_speaker 23

Inside the Leslie 24

Leslie Operation Schematic operation of the Leslie horn. Rotating horn (and dummy horn) Multiple image sources due to cabinet reflections Reflections heard with different Doppler shifts 25

Rotating Horn Simulation Horn source-position model: [ ] rs cos(ω m t) x s (t) = r s sin(ω m t) where r s = circular radius ω m = angular velocity This expression ignores any directionality of the horn radiation, and approximates the horn as an omnidirectional radiator located at the same radius for all frequencies. Horn source-velocity model: v s (t) = d dt x s(t) = [ rs ω m sin(ω m t) r s ω m cos(ω m t) For circular motion about the origin, tangential velocity is always orthogonal to the position ] 26

Rotating Horn Doppler Shift θ s x l = (r l,0) 0 x sl = x l x s v sl x s v s Relevant geometry for a rotating horn Source velocity projected onto source-listener path: v sl = P xsl (v s ) = v s,x l x l x s 2(x l x s ). Choosing x l = (r l,0) yields [ r l r s ω m sin(ω m t) rl r s cos(ω m t) v sl = rl 2 +2r l r s cos(ω m t)+rs 2 r s sin(ω m )t Far field approximation: v sl r s ω m sin(ω m t) [ 1 0 ]. ]. 27

Rotating Horn Doppler Shift, Cont d Substituting into the Doppler formula with the listener velocity v l set to zero yields ω [ s ω l = 1+r s ω m sin(ω m t)/c ω s 1 r ] sω m sin(ω m t), c where the approximation is valid for small Doppler shifts. Thus, in the far field, a rotating horn causes an approximately sinusoidal multiplicative frequency shift: Doppler shift = horn length r s times horn angular velocity ω m divided by sound speed c Note that r s ω m is the tangential speed of the assumed point of horn radiation. 28

Computational Modeling of the Leslie Leslie Free-Field Horn Measurements Rotating horn recording set up 29

Microphone close-up Horn set manually to fixed angles from -180 to 180 degrees in increments of 15 degrees Impulse response measured using 2048-long Golay-code pairs (see MUS424) 30

Measured impulse responses 7 impulse responses, theta = [ 180:30:180] 6 5 4 amplitude 3 2 1 0 1 0 1 2 3 4 5 6 time milliseconds Measured impulse-responses of the Leslie 600 rotating-horn at multiples of 15 degrees. The middle trace is recorded with the microphone along the axis of the horn Note leakage component from base of horn 31

Measured amplitude responses 0 Leslie response power spectra, theta = [ 180:30:180] 10 20 power db 30 40 50 60 10 1 10 0 10 1 frequency khz Measured amplitude-responses of the Leslie 600 rotating-horn at multiples of 15 degrees 32

Sound Example Input signal (sinusoids) Measured horn output signal Simulated horn output signal 33