- Flanging involves the summing together of a signal and a time-varying delayed version of itself.
- The input-output relationship for a flanger is given by:

*y*[*n*] =*x*[*n*] +*g x*[*n*-*M*[*n*]],

where*M*[*n*] is the time-varying length of a delay line and*g*is the ``depth'' of the flanging effect. A flanger block diagram is shown in Fig. 1. - Because the delay-line length,
*M*[*n*], must change continuously and smoothly through time, it is necessary to make use of an interpolating delay line. - At any instant in time, the flanger is equivalent to a feedforward comb filter, which has a frequency response as shown in Fig. 2.
**Figure 2:**Magnitude response of a feedforward comb filter with*M*= 5,*b*_{0}= 1, and*g*=*b*_{M}= 0.1, 0.5, and 0.9. - For
*g*> 0, there are*M*peaks in the frequency response, centered about the frequencies . Between these peaks, there are*M*notches at intervals of*f*_{s}/*M*Hz. - As
*M*changes over time, the peaks and notches of the comb response are compressed and expanded. The spectrum of a sound passing through the flanger is thus accentuated and deaccentuated by frequency region in a time-varying manner. - The delay-line length of a flanger is typically modulated by a low-frequency oscillator (LFO). Oscillator waveforms are typically sinusoidal, triangular, or exponential.
- For a sinusoidally varied delay,

where*f*is the flanger ``rate'' in Hz,*A*is the ``excursion'' (maximum delay swing), and*M*_{0}is the average delay-line length that controls the average notch density. - For values of
, the peaks and notches of the comb filter trade places. In practice,
*g*is normally contrained to the interval [0,1] and the option of sign inversion is provided by a ``phase inversion'' switch. - In the inverted mode, a notch is located at zero frequency. As a result, bass response will likely be weakened.
- Some flangers also implement feedback (in addition to the delayed feedforward path), which introduces spectral peaks and notches as previously described for feedback comb filters.
- The following MSP patch implements a flanger.

- A phaser, or phase shifter, is similar to a flanger in that it sweeps notches through the spectrum of an input signal. But while a flanger provides only uniformly spaced notches, a phasor can modulate the frequencies of non-uniformly spaced notches.
- A phaser is implemented with allpass filters instead of delay lines, as shown in the block diagram of Fig. 3.
- Second-order allpass filters are particularly convenient to use because each can control a separate notch frequency and bandwidth. Second-order allpass filters have a transfer function given by

where

*R*is the radius of each pole relative to the*z*-plane unit circle (R=1), and the pole angles are . The pole angle can be interpreted as where is the frequency and*T*is the sampling period. - The phaser will have a notch wherever the phase of the allpass chain is at (180 degrees). This happens very close to the complex-conjugate pole pair angles.
- The instantaneous frequency response of a phaser created using 4 second-order allpass filters with notch frequencies set at 300, 800, 1000, and 4000 Hz and R = 0.9, 0.98, 0.8, and 0.9 is shown in Fig. 4.
**Figure 4:**Instantaneous frequency response of a phaser created with 4 second-order allpass filters and notch frequencies set at 300, 800, 1000, and 4000 Hz. - The depth of the notches can be varied together by changing the feedforward gain parameter
*g*. - To achieve the time-varying ``phasing'' effect, the notch frequencies are modulated with a periodic signal. Note that only a single filter coefficient need be changed in each allpass section to accomplish this.

Doppler Effect

- The Doppler effect occurs when a sound source and listener are moving relative to one another. When the source and listener move toward each other, the sound is perceived to increase in frequency. When the source and listener move away from each other, the sound is heard to decrease in frequency.
- The Doppler effect can be used to enhance the realism of simulated moving sound sources.
- The amount of frequency shift is given by:

where*f*_{s}is the frequency of the source at rest,*f*_{l}is the frequency perceived by the listener,*v*_{ls}is the speed of the listener toward the source (zero if not moving),*v*_{sl}is the speed of the source toward the listener (zero is not moving), and*c*is the sound speed. - We can simulate time-varying source and listener velocities using a time-varying digital delay line with separate read and write pointers. The write pointer corresponds to the source signal and the read pointer corresponds to the listener. If the source position is moving toward the listener, the write pointer increment should be changed from 1 to 1 +
*v*_{sl}/*c*. Likewise, if the listener is moving toward the source, the read pointer increment should be changed from 1 to 1 +*v*_{ls}/*c*. - Interpolated reads from a delay line (fractional delay lengths) were previously discussed. Interpolated writes are referred to as de-interpolation.
- Because Doppler shift is dependent only on the relative motion of a source and listener and because the de-interpolation process is generally more complicated to implement than interpolation, it is best to change only the read pointer increment when possible.
- A continuously varying delay can be implemented with a ``growth parameter''
*g*= -*v*_{ls}/*c*such that the read pointer is incremented by 1 +*g*at each time step. - Multiple read pointers can simulate multiple moving listeners.
- Multiple write pointers can simulate multiple moving sources.
- It is not possible to use a single delay line to simulate both multiple moving listeners and multiple moving sources. In this case, the number of necessary delay lines is the lesser of the number of listeners or sources.

- The simulation of many apparent similar sound sources occuring nearly in unison from a single, actual source is referred to as a chorus effect.
- The chorus effect is achieved by applying various independent modifications to multiple copies of a given input signal and summing them together to create the output signal.
- Signal modifications can include delay, frequency shift, and/or amplitude changes.
- Time-varying delay lines can simulate changes in delay and frequency shift.
- A single multi-tap interpolating delay line with modulated ouput tap locations can efficiently and effectively implement the chorus effect.
- The following MSP patch implements a chorus effect. Better results can be achieved with more ``copies'' of the input signal.

- The Doppler effect causes a source signal to appear as though it has been pitch shifted. Pitch shifting of an input signal can thus be implemented with time-varying delay lines as described above.
- Because the read pointer of a pitch shifter is incremented at a constant non-integer rate, the read pointer will eventually ``catch up to'' or ``fall back into'' the write pointer location. To avoid discontinuity issues caused when the read and write pointers cross, a multiple read pointer cross-fade system can be used.

©2004-2016 McGill University. All Rights Reserved. Maintained by Gary P. Scavone. |