Compressor/hr

The Compressor effect reduces the dynamic range of audio.

One of the main purposes of reducing dynamic range is to permit the audio to be amplified further (without clipping) than would be otherwise possible. Therefore by default the Compressor amplifies audio as much as possible after compression. The resultant increase in average or RMS level can be useful for audio played in a noisy environment such as in a car, or in speech, to make a distant voice sound as loud as a close one. Because the gain changes relatively slowly, a compressor does not distort the signal in the way that a Limiter or clipping would do.


 * Accessed by: Effect > Compressor...
 * [[Image:Dynamic_range_compressor_basic7.png|Compressor settings window]]

Graph
The graph shows the input level along the bottom (horizontal axis) and the output level scale on the left (vertical axis) to illustrate the dynamic range compression effect. The graph will change as you adjust the Threshold and Ratio sliders, reflecting those settings. The graph does not reflect changes in any of the other controls, although they all affect how the audio sounds after applying the effect.

Controls

 * Threshold: The level above which compression is applied to the audio.


 * Noise Floor: The compressor adjusts the gain on audio below this background level so as to prevent it being unduly amplified in processing. This is mainly useful when compressing speech, to prevent the gain increasing during pauses and so over-amplifying the background noise.


 * Ratio: The amount of compression applied to the audio once it passes the threshold level. The higher the Ratio the more the loud parts of the audio will be compressed. The Ratio sets the slope of the blue line on the graph above the threshold.


 * Attack Time: How soon the compressor starts to compress the dynamics after the threshold is exceeded. If volume changes are slow, you can push this to a high value. Short attack times will result in a fast response to sudden, loud sounds, but will make the changes in volume much more obvious to listeners.


 * Decay Time: How soon the compressor starts to release the volume level back to normal after the level drops below the threshold. A long time value will tend to lose quiet sounds that come after loud ones, but will avoid the volume being raised too much during short quiet sections like pauses in speech.


 * Make-up gain for 0 dB after compressing: Boosts the resultant audio after compression to a peak level of 0 dB.


 * Compress based on Peaks: Base the threshold and gain adjustment on peak values of the waveform rather than the average (RMS) value used when in default (unchecked) state. When using RMS, the compressor uses "downward" compression, making louder sounds above the threshold quieter while leaving quieter ones below it untouched. When using peak values, "upwards" compression is applied which makes the entire audio louder, but amplifies the louder sounds above the threshold less than those below it.

Gale: haven't followed the discussions on this, but needs explaining why RMS threshold line is not at -18 dB. How was the graph produced? The Audacity compressor graph can't produce an input/output at -60 dB with a -18 dB threshold.

Steve the Fiddle As is indicated on the graph, the x axis shows peak dB. A waveform that has an RMS level of -18dB will have a peak level somewhat higher than -18dB (as is indicated on the graph). The exact peak dB level is dependent on the waveform but for a sine wave is approximately 3dB higher than the RMS level.

When using RMS compression, the compression begins at a level several dB higher than the peak level that the user can observe. This impacts on the user and so has been included in the illustration.

For example, if the compressor threshold is set to -18dB and the effect is set to compress based on RMS, the effect on a sine wave will be that compression does not start to occur until the RMS level reaches -18dB which is equivalent to a peak level of -15dB. For square waves the peak and RMS levels are equal. For white noise the RMS level is approximately 4.5dB below the peak level. For white noise, while the compression begins when the RMS level reaches -18dB, the peak level will be around 13.5dB

The graph, as it says in the text directly above the graph, is an illustration. It does not represent the graph display in the compressor GUI, which as explained in the previous section is not an accurate plot of the actual input/output levels. The graph that is displayed in the GUI is based only on the Threshold and Ratio slider settings. It does not take account of any other settings such as make-up gain or if RMS based compression is selected (in which case downward compression is used).

Looking at this again I can see that the graphs are not quite correct. I'll have another go at this. Complete accuracy can not be attained with a simple 2 axis graph because the actual output is also dependant on the Noise floor setting and the time domain so we are just trying to indicate a general expectation of what will occur without getting bogged down in too much technical detail. (and the precise working of this compressor are very complex with peculiarities unknown in any other compressor).

Gale: Several people have complained about the illustrative graph and I don't have knowledge enough or time enough to research the subject. But fundamentally the message seems to be the illustrative graph is confusing (novices) and it seems to beg questions that (as you suggest) may be too complex to explore. As it is I think it needs to be explained at least a bit more, or retired.
 * On the input axis of the graph, the RMS level appears to be above the peak level (louder) because of the arrow labeling, yet people can see the input waveform and RMS there is of course below peak. The blue dotted vertical line suggests that when the effect is set to compress based on RMS, compression starts at a peak level of -15 dB or whatever, true? OK, so I suggest we say the graph values are peak values and the arrows should say "-18 dB threshold using peak compression" and "-15 dB threshold using RMS compression".
 * Does the red line in the non-GUI graph actually illustrate peak (upwards) compression?

Bill 02Jul11: I vote to retire the graph, despite the work that Steve and I put into it. I don't think we'll ever reach a satisfactory version that is both accurate (and thus appropriate for audio pros) and understandable to novices. As for those experienced with hardware compressors and who want that type of experience, they're going to have to use a DAW that has real-time effects, since IMO you really need real-time feedback as you make adjustments to get the right settings for the material you are compressing.
 * Peter 3Jul11: ok, gets my vote for graph removal too - not worth the hassle
 * Steve 4Jul11: OK, graph removed - does the compressor require any further explanation or is it sufficiently clear as it is?
 * Peter 7Jul11: seems clear enough to me.

Example
Gale 04Nov11: Steve 04Nov18:
 * Should we not mark the threshold line?
 * Is it a good idea to show what "some" compressors do rather than say what ours does? Our release does seem to affect audio below the threshold.
 * Images updated to show compression with Audacity 1.3.x Compressor.

Uncompressed:

A simple sine wave that drops off by 12 dB half way through the selection, to demonstrate how the Audacity compressors handle signals.

When Compress based on Peaks is not selected, audio with an RMS level beyond the threshold range will be reduced. If Make up gain is enabled then the entire selection will be boosted to make up for this gain reduction.

When Compress based on Peaks is selected, audio with a peak level within the threshold range will be boosted.

.
 * [[Image:Compressor-before.png|Uncompressed signal]]

After:

In this example:
 * Compressing based on peaks is enabled so audio with a peak level below the threshold is boosted.
 * Attack is 0.5 second.
 * Decay is 1.0 second.
 * Ratio is 10:1.

The attack and release parts of where the compressor is working is clearly visible before and after the high level waveform.


 * [[Image:Compressor-after.png|Compressed signal]]