-
Notifications
You must be signed in to change notification settings - Fork 42
Dynamic range compression
If you are unfamiliar with dynamic range compressors and don't know what each parameter means, look at http://en.wikipedia.org/wiki/Dynamic_range_compression. Or even better, read "Digital Dynamic Range Compressor Design -- A Tutorial and Analysis", JAES2012, on which compressor of qaac is implemented.
In wikipedia term, this compressor does "downward compression". That is, loud sounds over threshold are attenuated. This compressor takes 5 parameters: threshold, ratio, knee width, attack, release.
This compressor basically is "peak sensing". When both of attack/release time are set zero, resulting gain is computed directly sample by sample, using threshold, ratio, and knee width. This yields very tight peak control and much distortion. Therefore, setting zero attack/release is generally not recommended.
When attack/release is set non-zero, computed control gain (adjustment to the volume) is lowpassed. This allows smooth transition to final stage through attack/release time, and also issues of straightforward peak sensing (too quick gain change, distortion) are decreased. Shape of transition is exponential in the log(dB) domain.
Note that in this implementation, actual release time will be approximately equal to attack + release given by parameter. This is by nature of "smooth, decoupling peak detector" in the paper, used by this compressor.
--drc -4.5:2.25:0:1.5:150
threshold:-4.5dBFS
2.25:1 compresion
knee width 0dB (=hard knee)
attack time 1.5ms
release time 150ms
Note that this is example is by no means a "recommendation", but just illustrates how to set parameters. As for dynamic range compression, there's no single "best" solution that works for everything.