Gain Filtering

Full-bandwidth processing of audio levels can be neatly represented with graphs.

Please Remember:

The opinions expressed are mine only. These opinions do not necessarily reflect anybody else’s opinions. I do not own, operate, manage, or represent any band, venue, or company that I talk about, unless explicitly noted.

gainfilteringWant to use this image for something else? Great! Click it for the link to a high-res or resolution-independent version.

I really like cross-disciplinary concepts. The idea that fractal geometries are present in audio, for instance, is fascinating to me.

A non-audio discipline that I love very much is computer graphics. I’ve been a fan for a long time, long enough that I’ve been dinking around with pixels for (probably) longer than I’ve been dinking around with sound. A lot of sonic concepts are applicable in the visual world, and I even wrote a whole article about how audio processing can be understood in terms of graphics. In a certain sense, this article is a specialized extension of the other article I just mentioned.

A graphics program that I particularly enjoy is Vue. Vue is a “digital nature” program; a software package primarily meant for creating artificial environments. Whether you dig deeply into Vue or not, a concept and tool that you encounter fairly swiftly is that of filtering. Vue filters are a way of mapping input values to output values such that the correspondence isn’t necessarily 1:1. Vue lets you implement filters in various ways, but a full-control filter is represented as a graph:

vuefilter

Simple Gain Operations

Where things get interesting is when you come to a realization: That variable mapping of input levels to output levels is a “gain” operation, and that, of course, we have LOTS of gain operations in audio. What I mean is that audio-humans spend their entire careers applying signal-level multipliers to inputs. That multiplier might be “1,” also known as the multiplicative identity, which is the equivalent of passing an entire signal across a gain stage without changing it at all. That multiplier might also be “0,” which is what functionally occurs when you yank a fader down to -∞. Any signal level multiplied by zero becomes zero, so no signal appears at the gain stage output.

I’ll show you.

Here’s a Vue altitude function with a “straight through” filter. This is the equivalent of a fader being set to 0 dB. The difference between the input and the output is 0 dB – the gain multiplier is “1.”

1to1

Pulling a fader down results (or should result) in a signal transfer that is still linear, but also where an input of “i greater than 0” is output as “signal less than i.” In other words, a signal with a value greater than zero comes out as a version of itself with reduced level. Zero stays zero, because you can’t make actual silence quieter. Signals at low level disappear into the noise floor.

Important: Vue is meant to help you make things which look nice, so it’s not a model of a perfect audio circuit. As such, you’ll notice that the transfer of this “fader” is not entirely linear. This is a limitation of the example and not necessarily how you should expect things to work in real life.

faderdown

faderdownoutput

Slam the fader all the way down, and of course, nothing comes out. All signal levels map to zero.

faderfulldown

(I don’t really need to show a picture which is nothing but full-black pixels, do I?)

Dynamics Processing

Gain filtering is much more than simple faders, of course. Audio humans are very fond of non-linear gain operations, like compression.

Also Important: Vue filters are invariant with respect to time – they do not require even a nanosecond to react to an input signal. Almost every audio-oriented, nonlinear gain filter IS time variant in some respect. The delay between one gain state and another may be very small, and may only be required for gain which is returning to a multiplier of “1,” but the time involved still is NOT zero.

Anyway.

We’ll start with this unfiltered “signal:”

unfiltered

Dynamics Reduction

A basic compressor is a nonlinear gain filter that uses a breakpoint to join two linear gain functions with different slopes. The breakpoint is where the filter slope changes to resist signal level increases. In the parlance of sound practitioners, the breakpoint is the threshold. The slope of the post-breakpoint filter is the ratio.

compressor

compressed

A brickwall limiter is the same thing, but the post-breakpoint slope is horizontal (or very nearly so). Past the threshold, the output signal level does not increase appreciably, even if the input signal is large.

brickwall

brickwalled

A compressor with a “knee” is where the transition between gain slopes is, itself, sloped or curved. The compressor effectively incorporates multiple ratios, and if the “knee” covers a wide range of input levels, the entire compressor may appear to be nonlinear.

knee

kneed

Dynamics Expansion

A simple, downward expander is a kind of inverted compressor. It also features a breakpoint which joins two gain functions with different slopes. In an expander, however, the “compression” slope occurs before the breakpoint. Depending upon how you interpret the operation, an expansion device either pulls pre-breakpoint inputs down closer to silence, or you might say that it resists output increases until a certain input-side signal level is detected. (Things become even more interesting when you can supply inputs to the detector that are independent of the gain filter’s audible signal path.) The expander becomes 1:1 after the threshold. Fiddling with attack and release times may be required to make the transition pleasant, because the transition can involve not only an abrupt change in gain slope, but also a very high gain slope within that transition.

The possibility also exists to make the transition slope gradual, independent of the time required for a gain change to occur. In any case, here’s the simplified example:

expander

expanded

Gates are the “brickwall limiter” version of an expander. The gain filter applied to any signal below the threshold is “multiply by zero.”

gate

gated


The point of all this is to have an alternate route to interpreting how gain processing works. Maybe this is helpful; hopefully, it’s at least not confusing. Obviously, I can’t cover every quirk of every dynamics processor available, but maybe this helps you connect a few things in your mind.