Flanger Flange Comb Filter Parameters Fractional Delay Using

Flanger Flange Comb Filter Parameters Fractional Delay Using

Flanger Music 206: Delay and Digital Filters II flanger Tamara Smyth, [email protected] • The well known is a feedforward comb filter Department of Music, with a time-varying delay M(n) (see flanging.mov). University of California, San Diego (UCSD) • Flanging, used in recording studios since the 1960s, April 18, 2019 creates a rapidly varying high-frequency sound by adding a signal to an image of itself that is delayed by a short, variable amount of time. • Flanging was accomplished in analog studios by summing the outputs of two tape machines playing the same tape. flange y(n) Figure 1: Two tape machines are used to produce the flanging effect. • By touching (and releasing) the flange on one supply reel, it would s to slow it down (and speed it up). 1 Music 206: Delay and Digital Filters II 2 Flange Comb Filter Parameters Fractional Delay using Linear Interpolation • The flange simulation is a feedforward comb filter, where the delay M(n) is a function of time, • For a successful flanging effect, M(n) must change smoothly over time: y(n)= x(n)+ gx(n − M(n)). – M(n) should not have jumps in values associated – coefficient g (DEPTH parameter), determines the with rounding to the nearest integer. prominence of the flanging effect. • One of the simplest ways to handle fractional delay is – flange is typically swept from a few milliseconds to by using linear Interpolation: 0 to produce characteristic “flange” sound. – the linear interpolator effectively “draws a line” • The time-varying delay can be handled by modulating between neighbouring samples, and returns the M(n) with a low-frequency oscillator (LFO) sinusoid: appropriate value on that line. M(n)= M [1 + A sin(2πfnT )], 0 Linearly interpolating to obtain value at sample 8.25 1 where 0.5 f , rate or speed of the flanger, in Hz 0 amplitude A , “excursion” (maximum delay swing) −0.5 −1 , 7.5 8 8.25 8.5 9 9.5 M0 average delay length controlling the time (samples) average notch density. Figure 2: Linear Interpolation. Music 206: Delay and Digital Filters II 3 Music 206: Delay and Digital Filters II 4 Linear Interpolation (Implementation) Tapped Delay Line • The fractional part of the delay, δ, effectively • A tap refers to the extraction of the signal at a determines how far to go along the line between certain position within the delay-line. samples. • The tap may be interpolating or non-interpolating, • A fractional delay xˆ(n − (M + δ)), reads from the and also may be scaled. delay line at neighbouring delays M and M +1, and • A tap implements a shorter delay line within a larger takes the weighted sum of the outputs: delay line. xˆ(n−(M +δ)) = (1−δ)x(n−M)+δx(n−(M +1)), −M1 −(M2−M1) x(n) z z y(n)= x(n − M2) where M is the integer and δ is the fractional part. b1 • Notice that if δ =0, the fractional delay reduces to b1x(n − M1) the regular integer delay. Figure 3: A delay line tapped after a delay of M1 samples. • Linear interpolation in a circular delay line (Matlab): if (outPtr==1) z = (1-delta)*dline(outPtr) + delta*dline(Mmax); else z = (1-delta)*dline(outPtr) + delta*dline(outPtr-1); end Music 206: Delay and Digital Filters II 5 Music 206: Delay and Digital Filters II 6 Multi-Tap Delay Line Example Chorus • Multi-Tapped delay lines efficiently simulate multiple • A Chorus is produced when several musicians play echoes from the same source signal. simultaneously, but inevitably with small changes in the amplitudes and timings between each individual’s x(n) z−M1 z−(M2−M1) z−(M3−M2) sound. b0 b1 b2 b3 y(n) • The chorus effect is a signal processing unit that Figure 4: A multi-tapped delay with length M3. changes the sound of a single source to a chorus by implementing the variability occurring when several • In the above figure, the total delay line length is M3 sources attempt to play in unison. samples, and the internal taps are located at delays of M1 and M2 samples, respectively. • The output signal is a linear combination of the input signal x(n), the delay-line output x(n − M3), and the two tap signals x(n − M1) and x(n − M2). • The difference equation is given by y(n)= b0x(n)+b1x(n−M1)+b2x(n−M2)+b3x(n−M3) • Convolution is equivalent to tapping a delay line every sample and multiplying the output of each tap by the value of the impulse response for that time. Music 206: Delay and Digital Filters II 7 Music 206: Delay and Digital Filters II 8 Chorus Implementation A Simple Recursive (IIR) Filter • A chorus effect may be efficiently implemented using • Using FIR filters to reproduce a desired frequency a multi-tap fractional delay line: response often requires a very high-order filter, i.e., a greater number of coefficients and more computation. – taps are not fixed and usually range from 10 to 50 ms. • It is often possible to reduce the number of – their instantaneous delay may be determined using feedforward coefficients by introducing feedback a random noise generator or, as in the flanger, a coefficients. Low Frequency Oscillator (LFO). • A simple first-order recursive low-pass filter is given by y(n)= x(n)+ .9y(n − 1) g1 z−M1(n) y(n) = x(n)+x(n−1) 1 0.8 g2 M2(n) z y(n) 0.6 x(n) 0.4 g3 0.2 amplitude (linear) −M3(n) z 0 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 y(n) = x(n)+.9y(n−1) g4 1 z−M4(n) 0.8 0.6 Figure 5: A bank for variable delay lines realize the chorus effect. 0.4 0.2 amplitude (linear) 0 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 • The chorus is similar to the flanger, only there are frequency (normalized) multiple delayed copies of the input, and the delay times are typically longer (where a flanger is about Figure 6: The spectral magnitude of the first-order FIR and IIR (recursive) lowpass filters. 1-10 ms, a chorus is about 10-50 ms). Music 206: Delay and Digital Filters II 9 Music 206: Delay and Digital Filters II 10 The General Difference Equation for The Simple Feedback Comb Filter LTI filters • What happens when we multiply the output of a delay • The general difference equation for LTI filters includes line by a gain factor g then feed it back to the input? feedback terms, and is given by x(n) y(n) g y(n)= b0x(n) + b1x(n − 1) + ··· + bM x(n − M) z−M − a1y(n − 1) −···− aN y(n − N) Figure 7: The signal flow diagram of a comb filter. • This can be implemented in Matlab using the filter function: • The difference equation for this filter is B = ...; % feedforward coefficients y(n)= x(n)+ gy(n − M), A = ...; % feedback coefficients y = filter(B, A, x); • If the input to the filter is an impulse • Matlab specifies coefficients according to the filter x(n)= {1, 0, 0,...} transfer function and NOT the difference equation: the output (impulse response) will be ... – all feedback coefficients (except the first) have a 1 sign opposite to that in the difference equation; – this is explained by moving the y terms in the Amplitude g g2 difference equation to the left of the equal sign (a g3 step in arriving at the filter transfer function): 0 τ Time (s) y(n)+a1y(n−1)+··· = b0x(n)+b1x(n−1)+··· Figure 8: Impulse response for filter y(n)= x(n)+ gy(n − M), where τ = M/fs. Music 206: Delay and Digital Filters II 11 Music 206: Delay and Digital Filters II 12 Effect of Feedback Delay Effect of the Feedback coefficient g • Since the pulses are equally spaced in time at an • Coefficient g is the depth parameter, where values interval equal to the loop time τ = M/fs seconds, it closer to 1 yield more extreme maxima and minima. is periodic and will sound at the frequency f0 =1/τ. Comp filter feedback coefficient g = 0.1 1 0.8 0.6 0.4 Simple feedback comp filter where feedback coefficient g = 0.8 Amplitude 0.2 1 0 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 Time (s) 0.8 0 −5 0.6 −10 −15 0.4 −20 Magnitude (dB) Amplitude −25 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 0.2 Frequency (H) Comp filter feedback coefficient g = 0.5 1 0 0.8 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 0.6 Time (s) 0.4 Amplitude 0.2 0 0 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 Time (s) 0 −5 −5 −10 −10 −15 −20 Magnitude (dB) −25 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 −15 Frequency (H) Magnitude (dB) Comp filter feedback coefficient g = 0.9 1 0.8 −20 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 0.6 Frequency (H) 0.4 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 Time (s) Figure 9: Impulse and magnitude response of a comb filter with feedback g = 0.8.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 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