1 Flanging
Martin Guy edited this page 2025-01-01 20:05:58 +01:00

Flanging

By Scott Lehman

Part of the series of articles Effects Explained

Recovered from archive.org

Introduction

Flanging has a very characteristic sound that many people refer to as a "whooshing" sound, or a sound similar to the sound of a jet plane flying overhead. Sound Set 1 presents a basic dry drum loop and that same drum loop with flanging applied.

.au file (64K) .wav file (127K) .mp2 file (64K)

Sound Set 1: A drum loop dry, followed by the same loop with flanging applied.

Flanging is generally considered a particular type of phasing (another popular effect). As will be shown below, flanging creates a set of equally spaced notches in the audio spectrum. Phasing uses a set of notches as well, but the spacing of them can be arbitrary and the notches in a phaser are usually created using allpass filters.

How it Works

Flanging is created by mixing a signal with a slightly delayed copy of itself, where the length of the delay is constantly changing. This isn't difficult to produce with standard audio equipment, and it is believed that flanging was actually "discovered" by accident. Legend says it originated while the Beatles were producing an album. A tape machine was being used for a delay and someone touched the rim of a tape reel, changing the pitch. With some more tinkering and mixing of signals, that characteristic flanging sound was created. The rim of the reel is also known as the 'flange', hence the name 'flanging'.

Most modern day flangers let you shape the sound by allowing you to control how much of the delayed signal is added to the original, which is usually referred to as a 'depth' control (or 'mix'). Figure 1 is a diagram of a simple flanger with this depth control.

Diagram of a flanger

Figure 1: Diagram of a simple flanger. The delay changes with time.

When we listen to a flanged signal, we don't hear an echo because the delay is so short. In a flanger, the typical delay times are from 1 to 10 milliseconds (the human ear will perceive an echo if the delay is more than 50-70 milliseconds or so). Instead of creating an echo, the delay has a filtering effect on the signal, and this effect creates a series of notches in the frequency response, as shown in Figure 2. Points at which the frequency response goes to zero means that sounds of that frequency are eliminated, while other frequencies are passed with some amplitude change. This frequency response is sometimes called a comb filter, as its notches resemble the teeth on a comb.

Frequency response of a flanger

Figure 2: The frequency response of a simple flanger with two different delay times (both with a depth of 1). The plot on the left would be for a flanger with a smaller delay than that on the right.

Derivation of the Flanger's Frequency Response

Derivation of the Flanger's Frequency Response

These notches in the frequency response are created by destructive interference. Picture a perfect tone - a sine wave. If you delay that signal and then add it to the original, the sum of the two signals may look quite different. At one extreme, where the delay is such that the signals are perfectly out of phase, as one signal increases, the other decreases the same amount, so the entire signal will disappear at the output. Of course, the two signals could still remain in phase after the delay, doubling the magnitude of that frequency (constructive interference). For any given amount of delay, some frequencies will be eliminated while others are passed through. In the flanger, you can control how deep these notches go by using the depth control. When the depth is at zero, the frequency response is flat, but as you increase the depth, the notches begin to appear and extend downward, reaching zero when the depth is one. Even if the notches do not extend quite all the way to zero, they will still have an audible effect.

The characteristic sound of a flanger results when these notches sweep up and down the frequency axis over time. Picture the notches compressing and expanding like a spring between the two plots in Figure 2. (If you have Quicktime installed on your computer, you can try a quicktime movie of a flanger (383K) that demonstrates the sweeping with an audio track. You may want to have your player loop the movie.) The sweeping action of the notches is achieved by continuously changing the amount of delay used. As the delay increases, the notches slide further down into the lower frequencies. The manner in which the delay changes is determined by the LFO (Low Frequency Oscillator) waveform (discussed below).

This changing of the delay in the flanger creates some pitch modulation - the perceived pitch 'warbles'. This happens because you have to 'read faster' or 'read slower' from the delayed signal. Picture a flanger created by two tape reels running the same audio signal. To increase the delay between the two signals, you have to slow one of the reels down. As you may know from experience, as you slow down a tape, the pitch drops. Now to decrease the delay, you have to catch up - sort of like fast forwarding, which increases the pitch (also known as the 'munchkin effect'). Of course only the delayed copy of the sound has this pitch change, which is then mixed in with the unaltered signal.

Common Parameters

Depth (Mix)

This is the depth parameter referred to above. The larger the depth, the more pronounced the notches in the flanger. In multieffects units, the depth may only be controllable in the mixer section, and not available within the flanging processor. Some people use the term 'mix' interchangeably with 'depth'.

Delay

The delay parameter specifies the minimum delay used on the copy of the input signal - as the delay changes, this will be the smallest delay. Looking at the frequency response, this value determines how high the first notch will go. As the delay is increased, the first notch drops down. In some cases, the delay parameter can be set to zero, in which case the notches will sweep the uppermost frequency range, and essentially disappear momentarily. In other cases, you may not be able to control delay parameter.

Sound Set 2 contains the same drum loop used above with two different delay settings. Try to picture the notches sweeping up and down.

.au file (65K) .wav file (129K) .mp2 file (65K)

Sound Set 2: The drum loop flanged with a delay of 1 ms., and then 4 ms. Listen to the notches sweeping downward, then upward before returning the their initial location.

Sweep Depth (Width)

The sweep depth determines how wide the sweep is in terms of delay time - essentially the width of the LFO. This sweep depth is the maximum additional delay that is added to the signal in addition to the delay in the delay parameter. It determines how low the first notch in the frequency response will reach. A small value for the depth will keep the variance in the delay time small, and a large value will cause the notches in the frequency response to sweep over a larger area. Figure 3 shows how the delay and sweep depth parameters are related to the LFO. The minimum delay applied to the signal is given by the delay parameter, and the maximum delay is the sum of the delay and sweep depth parameters.

Plot of delay labeled with sweep depth and delay parameters

Figure 3: The relationship between the sweep depth and delay parameters.

As the sweep depth is increased, the pitch modulation effect mentioned above will become more noticeable. The flanger needs to read even faster or slower to change the delay in the same amount of time. Sound Set 3 gives an example of how the pitch modulation effect varies with the depth.

.au file (34K) .wav file (64K) .mp2 file (34K)

Sound Set 3: A plucked electric guitar string, first flanged with a depth of 2 ms., then with 6 ms. Note that the latter varies more in pitch.

Note that when you vary the delay parameter, both the upper and lower limits of the first notch are changed, but when you adjust the depth, only the lower limit is affected. So when you are setting up a flanger to sweep over a particular range, first set the delay so that the high point of the sweep is where you want it, and then adjust the sweep depth to set the low point of the sweep. (When I refer to the sweep here, I'm talking about the notches, not the delay time. Remember that the parameters you set are controlling the delay, and that the notches result from this delay. As the delay increases, the notch frequencies decrease.)

LFO Waveform

Some flangers will allow you to choose the LFO waveform. This waveform determines how the delay in the flanger varies in time. Figure 4 show some common LFO's. The triangle is probably the more common choice in flangers.

![Plot of common LFO waveforms}(images/flager-f4.gif)

Figure 4: Two common LFO waveforms.

Feedback/Regeneration

Some units will give you an option for taking a portion of the flanger's output and routing it to the input. In some cases, you can also specify whether to add or subtract the feedback signal. A large amount of feedback can create a very 'metallic' and 'intense' sound, as Sound Set 4 demonstrates. A diagram for the flanger with feedback is shown in Figure 5. Of course as the feedback gain approaches one, the system can be come unstable, possibly resulting in overflow or clipping.

.au file (22K) .wav file (43K) .mp2 file (22K)

Sound Set 4: Flanging with heavy feedback applied to a strummed chord.

![Complex flanger diagram with a feedback path}(images/flanger-f5.gif)

Figure 5: The more complex flanger including a feedback path and LFO control over the delay.

Speed/Rate

The speed control is pretty straightforward. This parameter refers to the rate at which the LFO waveform repeats itself, or equivalently, how many times per second the notches sweep up and down. The speed also affects the amount of pitch modulation. By increasing the speed, the flanger will have to sweep through the depth in less time.

Implementation

Analog

The most familiar analog delay method is the recordable tape loop, but the amount of delay needed in a flanger is so small that it would be impractical. The more practical approach is to use 'sample-and-hold' circuits. These circuits will take a snapshot of the input voltage, and hold it until the circuit is triggered to take another snapshot. (This is essentially the same circuit that is used in analog-to-digital converters). The sample-and-hold circuit can hold the voltage by storing charge in a capacitance. Of course with a capacitance and the resistance in the circuit, there is some time delay before the voltage across the capacitance approaches the input voltage. These circuits must then be triggered at the right time, and possibly cascaded to achieve the needed delay.

Digital

In the digital realm, delays are implemented using delay lines or circular buffers (a chunk of memory is used to store a number of values, and you continuously read and write to that space). But implementing a continuously changing delay time makes it interesting. Since the samples are always taken one sampling period apart, you can't create a delay line whose delay is not an integral multiple of the sampling period. You can try reading values out of the delay line closest to the required point, you will hear a clicking in the output as the delay length changes, also called "zipper noise".

You can get around this by using interpolation. Interpolation is simple estimating a value of a function between two points. In this case, we have two samples and we want to get a value in between them. A simple method of interpolating is to connect the points with a line, and then read the desired value from that line. Although linear interpolation is simple, it can be noisy due to aliasing. It may be acceptable with very high sampling rates, but in some cases, a more computationally expensive interpolation method may be needed.

Other Notes

Disappearing Instruments

There is an interesting possibility when using a flanger with a musical instrument. For non-percussive instruments that generate a pitch and the harmonic overtones, the notches that the flanger produces could in theory coincide exactly with the fundamental and the overtones, eliminating the sound of the instrument altogether. In practice, an instrument won't disappear entirely, but there can be severe amplitude modulation. For this reason, some favor using flangers on percussive and noise-like signals (and this is partly why a drum loop was used in the sounds above. The notch effect is much clearer). In fact, flanging is often used on an entire mix, rather than a specific instrument within a mix.

Stereo Flangers

One method for creating a stereo flanger is to use two monophonic flangers in quadrature phase. This simply means that the LFO in each monophonic flanger differ in phase by ninety degrees (or one-quarter of a wavelength). This technique creates a 'wider' sound because the sound arriving at each of your ears is different. Sound Set 5 presents a mono source file processed by a flanger with stereo outputs. Compare it to the flanged audio clips from Sound Set 1 or 2. (If you are having trouble hearing any difference, make sure your computer is generating a stereo output, and use a pair of headphones.)

.au file (62K) .wav file (123K) .mp2 file (31K)

Sound Set 5 (Stereo): A stereo flanger applied to the opening drum loop.

From Flangers to Chorus

The basic structure of the flanger is very similar to that of a chorus effect. For a chorus, the delays used vary from 30 to 50 milliseconds. Chorusers generally do not have any feedback though.

To Learn More

Many popular sound editing programs have some flanging capability, but they might fairly limited. If you want to get your hands dirty and play around with flangers, here are a few sources.

If your computer is equipped with a Windows Sound System (WSS) or want to get your hands on some C source code, download the file audio.zip file (this accompanies the article in Dr. Dobb's Journal cited below). That file also includes assembly code for use with the Texas Instruments DSP Starter Kit, and there are some other effects algorithms given as well.

Macintosh users can experiment with the Reverb compiler (and as the name implies it can also create reverbs and other delay based effects). Real-time operation requires and Audiomedia card, but it can be used to process Sound Designer II type sound files in non-real-time. The program can be found on sound.media.mit.edu. To write your own Reverb programs, you have to be comfortable working directly with delay lines and applying operators directly on those delay lines. Some sample Reverb programs are included with the Reverb program itself to get you started.

There are a couple of Csound orchestras that were used for experimentation and used for some of the sounds in this article. Neither is truly a correct flanger, but it does work to some extent. The files are ![flanger-mono.orc](images/flanger-mono.orc] and flanger-stereo.orc. You can also get more information on Csound.

References

  • Cronin, Dennis "Examining Audio DSP Programs," Dr. Dobb's Journal, July 1994.
  • Computer Music: Synthesis, Composition, and Performance Dodge, Charles and Thomas A. Jerse. New York: Schirmer Books, 1984. (ISBN 0028646827)
  • Smith, Julius O. "An Allpass Approach to Digital Phasing and Flanging," Proceedings of the 1982 International Computer Music Conference.
  • Thorderson, Randy "Friday's Tip - FLANGER," Email message to DigiTech GSP-2101 Mailing List,17 November 1995.

© Scott Lehman and licensed to Harmony Central, LLC. All rights reserved. Harmony Central encourages linking from other sites to Harmony Central content.