Talk:Compressor

From Audacity Development Manual
Revision as of 23:16, 22 November 2009 by Stevethefiddle (talk | contribs) (suggestion for page)
Jump to: navigation, search

CompressorIOgraph.png

Steve, is this correct?

Compressor settings:

  • Threshold -12 dB
  • Ratio 4:1
  • Noise Floor -42 dB


  • Blue graph is IO characteristic for "compress based on peaks" OFF and "make-up gain" OFF
  • Red graph is IO characteristic for "compress based on peaks" ON and "make-up gain" OFF or ON
  • Green graph is IO characteristic for "compress based on peaks" OFF and "make-up gain" ON

-- Bill


The characteristics when "Make up gain" is on cannot really be shown on this type of diagram. Unlike (most) hardware compressors, the "make-up" gain is not a fixed amount to compensate for the lower output, but is a Normailize function. The amount of gain depends on the peak level of the audio after compressing. The solid red line is approximately the effect of normalizing (make-up gain to 0dB) if the uncompressed signal had a peak of 0dB.

In the diagram below there are several alternative "post-make-up gain" plots drawn. The lower the peak amplitude after compression, the more make up gain is applied. The make-up gain would be described better as "Normalize to 0dB after compression".

RMS based normalise.png

This also applies to "Make-up gain for 0 dB after compressing" when using "Compress based on Peaks".

When Compress based on Peaks is selected, the threshold will appear to be at a different level, because it is working with peak values rather than RMS values. It's a bit tricky to show in this kind of diagram because we're mixing peak and rms measurements.

When compression is based on RMS, a threshold setting of -12dB will begin compression at an RMS value of -12dB (roughly -9dB peak). When compression is based on Peak, a threhold setting of -12dB will begin compression at a PEAK value of -12dB.

Peak vs rms.png


I'll add some better diagrams for upward vs. downward compression shortly.--Steve the Fiddle 17:18, 20 November 2009 (UTC)

Then again, perhaps the above diagram is sufficient if we take out the (incorrect) noise floor part?

Perhaps a diagram indicating Peak level vs. RMS level?

Peak-vs-rms.png

--Steve the Fiddle 18:03, 21 November 2009 (UTC)

Bill: Steve, here's a graph of the actual IO characteristic using Compress based on peaks, threshold = -12 dB, no make-up gain, attack and decay at minimum, noise floor at -80 dB. The red curve is for a chirp from 0 to 1, the green curve for a chirp from 0 to -0.707 (-3 dB). Note that the knee for the first case is at -9 dB, and moves left for the second case. Other than that the curves are very similar.

Compressor IO graph2.png


Technical details and input-output graphs

When "Compress based on peaks" is not checked

The following image shows the input-output characteristic of the Compressor effect when "Compress based on peaks" is not checked.

  • The light blue line shows the characteristic when "Make-up gain for 0 dB after compressing" is not checked.
In this mode the Compressor effect behaves like a traditional hardware compressor.
  • The dark blue line shows the characteristic when "Make-up gain for 0 dB after compressing" is checked, and corresponds to the line shown on the graph in the Compressor dialog.
In this mode the Compressor effect behaves like a traditional hardware compressor with a "smart" output gain control.

Note that the line from the threshold point to the left of the graph always has a slope of 1. CompressorIOgraphRMS.png

This is implied by the graph on the effect, but the graph is wrong. After make up gain to 0dB has been applied the slope below the threshold is no longer 1. This is easy to see when you consider the case of silence (-inf dB) - both input and output are silence. Steve the Fiddle

When "Compress based on peaks" is checked

The following image shows the input-output characteristic of the Compressor effect when "Compress based on peaks" is checked.

  • The red line shows the characteristic when "Make-up gain for 0 dB after compressing" is not checked.
  • The orange line shows the characteristic when "Make-up gain for 0 dB after compressing" is checked and the input signal had a maximum peak value of less than 0 dB.

Note that the line from the threshold point to the left of the graph no longer has a slope of 1.


When "Compress based on peaks" is checked the Compressor effect applies "upward compression" to the input. This is very different from the behaviour of a traditional hardware compressor. Note that when the volume of the input is below the threshold the volume is "stretched" to fit the new post-compression range. Sounds above the threshold still receive downward compression. The result is that very quiet sounds are not significantly amplified.

CompressorIOgraphPeak.png


Here's my suggestion: Steve the Fiddle
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.
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 the settings made. The actual characteristics of the effect is also dependent on the other settings (not shown in the graph).

Controls

  • Threshold: Compression is applied to sounds above this level.
  • Noise Floor: This setting helps to prevent low level sound (background noise below this level) from being unduly amplified as a result of the processing.
  • 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 0dB.
  • Compress based on Peaks: The threshold and gain adjustment are based on peak values of the waveform rather than the average (RMS) value. The method used for compressing dynamics is different when this option is selected. When not selected, the compressor reduces the volume of louder sounds while leaving quieter ones untouched, but when "compress based on peaks" is selected, quieter sounds are amplified more than loud sounds. The result in both cases is to reduce the dynamic range of sounds above the threshold.


The illustration below compares characteristics of compression based on peak and compression based on average levels (before make-up gain).



Compression characteristics for peak based and rms based compression


Schematic example

Uncompressed: A simple sine wave that drops off by 6 dB half way through the selection, to demonstrate how some compressors handle signals.

Uncompressed signal

After: The attack part of where the compressor is working is clearly visible at the start of the audio.The release part still affects some audio that is beneath the threshold as the compressor gain change slowly ebbs out and the material fades back to normal level.

Compressed signal


Steve the Fiddle