Talk:Compressor
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".
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.
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?
--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.
Contents
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.
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.
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).
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.
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.
OLD CONTENTS OF THE MAIN PAGE
This page need a major make-over. The Compressor plugin now has another slider - Noise Floor - that needs to be documented. 'Normalize to 0 dB after compressing' now reads 'Make-up gain for 0 dB after compressing'. There is a checkbox for 'Compress based on peaks'. The blue line in the graph is now pinned to the upper-right instead of the lower-left. This is confusing for audio engineers as they're used to seeing compressor graphs with the curve pinned to the lower-left. The old graph was better in that regard. The new graph display is, I suppose, appropriate when the 'Make-up gain' option is chosen. It would be nice if the graph would change where it's pinned based on that option.
- Gale: I will raise this on -devel list - I don't recall any reason for the pinning axis changing, but I will ask. I agree Cool Edit Pro pins as you suggest.
All that aside, I guess we need to document what the Compressor currently does and how it behaves. I may have a go at describing how the graph works and what it means, after I un-learn 35 years of using compressors.
Does anybody know what the 'Noise Floor' slider does? - Bill W
- Gale: I had asked the contributor who made these changes to document them. I have some very basic information I can add based on the -devel list discussions. I think it's better I do that and you ask questions after that if you have suggestions for improvement.
Bill: I've gone ahead and documented this, as it seems unlikely to be fixed in time for 2.0.
Audio with a peak level below the "Noise Floor" is not changed.
Essentially, when "Compress based on peaks" is selected, there is dynamic expansion between the Noise Floor and Threshold, and dynamic compression above the Threshold.
Bill: Your third statement is correct, but it conflicts with your first statement. There is always downward compression above the threshold. How the code handles this I can't tell, but I've done a series of tests with chirps that clearly show that downward compression (according to the ratio) happens above the threshold when "compress based on peaks" is checked. You are correct about the "upward expansion" between the threshold and the noise floor when "compress based on peaks" is checked. Sounds below the noise floor are not amplified. Sounds with volumes between the noise floor and the new threshold (after downward compression and calculation of the amount of amplification possible after this compression?) have their volumes "stretched" to fit the new range. I you'd like I'd be happy to put some screenshots and a detailed step-by-step procedure on the talk page.
Graph
The graph shows the input level along the bottom (x-axis) and the output level along the left (y-axis). Note that the graph always goes through the (0,0) point at the upper right - this is consistent with the "Make-up gain for 0 dB after compressing" option. The graph will change as you adjust the sliders.
Controls
- Threshold: Sounds above this threshold will cause the compressor to reduce the level of the audio. It sets the horizontal (left to right) position of the corner of the blue line on the graph.
- Noise Floor: Sets the level below which make-up gain will not be applied. This prevents the compressor from amplifying noise.
When "Compress based on peaks" IS selected, the effect leaves sound below the Noise Floor unchanged, and upwardly expands between the Noise Floor and the Threshold, thus producing reduced (compressed) dynamic range above the Threshold.
- 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 turned down. The Ratio sets the slope of the blue line on the graph above the corner.
- Attack Time: How soon the compressor starts to reduce the volume level after it rises above the threshold. 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 increase 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 equally at all volume levels, to be as loud as possible without distortion. Because the compressor works by making loud sections quieter, you will usually want to do this. If this option is selected, the effect will be both to make the quiet sections of the audio louder, and increase the overall loudness.
- Compress based on Peaks: The threshold setting will react to the peak values of the waveform rather than the average value.
Bill: OK, I've done some more testing. I can create cases where there is a slight difference when "make-up gain" is ON versus OFF. In one test I did you could further amplify the compressed wave by 1 dB when "make-up gain" was OFF.
But there's that "upward compression" (expansion?) description again. If you treat this effect like a black box, give it a known input and look at the output, this is what appears to happen when "compress based on peaks" is checked. 1) Downward compression is applied to sounds above the threshold. 2) An amplification factor "A" is calculated based on the new peak amplitude of the selection (but it doesn't always get it right). 3) Sounds with volumes above the threshold are amplified by this factor. 4) Sounds below the noise floor are not amplified. 5) Sounds with volumes between the noise floor and the threshold are amplified by a factor between 1 and "A" depending on where their pre-compression volume was. Of course it doesn't actually work that way in the code, but this is the net effect.
Schematic example
A simple sine wave that drops off by 6 dB half way through the selection, to demonstrate how some compressors handle signals. |
![]() |
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. |
![]() |









