← All boards
Audio Effects › Dynamic Range Control

Compressor Built From Scratch

Plays on the mobile app
The Compressor Built From Scratch board in the WaveWarp DrawingBoard
Compressor Built From Scratch — the board as it opens in the WaveWarp DrawingBoard.

What it does

Audio dynamic range compressor built from basic elements.

A measurement of mean-square audio amplitude is used to generate a gain-reduction control signal (in red) which is multiplied by the input, thus compressing the output amplitude below the user-defined threshold. The logarithm block is required to convert the mean-square measurement to dB. The Compressor Threshold block compares the measured mean-square value (in dB) with the user-defined dB threshold (slider in the Compressor Threshold block), and generates a gain-reduction signal of a desired "compression ratio" if the mean-square value exceeds the threshold. The antillog of the control signal is taken (to convert back from dB). This signal is then smoothed and multiplied by a delayed version of the input audio signal, thus limiting the amplitude of the output audio signal. The gain smoother has a hysteresis loop to determine whether the compressor is in the attack or release phase. The delay gives the system a predictive ("look-ahead") capability. The output gain is required to compensate for large compression ratios. Experiment with the settings of all blocks to explore the behaviour of the compressor.

Effects used

10 blocks 10 connections
In WaveWarp, 1998

How the original documented it

Audio dynamic range compressor built from basic elements. A measurement of mean-square audio amplitude is used to generate a gain-reduction control signal (in red) which is multiplied by the input, thus compressing the output amplitude below the user-defined threshold. The logarithm block is required to convert the mean-square measurement to dB. The Compressor Threshold block compares the measured mean-square value (in dB) with the user-defined dB threshold (slider in the Compressor Threshold block), and generates a gain-reduction signal of a desired "compression ratio" if the mean-square value exceeds the threshold. The antillog of the control signal is taken (to convert back from dB). This signal is then smoothed and multiplied by a delayed version of the input audio signal, thus limiting the amplitude of the output audio signal. The gain smoother has a hysteresis loop to determine whether the compressor is in the attack or release phase. The delay gives the system a predictive ("look-ahead") capability. The output gain is required to compensate for large compression ratios. Experiment with the settings of all blocks to explore the behaviour of the compressor.

Components used (1998)

Output Single-Mono WAVE DriverInput WAV fileMean-Square ValueControl Smoother with AT-RTMultiply Audio by Control with GainControl AntiLog2Control Log2Simple delayCompressor Threshold