Compressor/Limiter

Home

 

Description

A compressor is used for reducing the dynamics of an audio signal. Levels louder than a user-specified threshold are reduced according to a compression ratio. A ratio of 2:1 indicates that above the threshold, an input signal level increase of 2 dB will raise the output signal level by 1 dB. A limiter is a compressor with a ratio of 10:1 or higher. The input signal is delayed long enough to test its level and compress it if it exceeds the threshold.

 

Graphical Depiction

The ‘Test Level’ function box compares the level of the input signal with the threshold value. If the threshold is greater, the gain output is equal to 1. If the input signal level is greater, the gain output is set to 1/ratio.

 

Effect Formula

y[n] = f(x[n]) * x[n]

y[n] = output signal

x[n] = input signal

f(x[n]) = 1 if x[n] <= threshold

f(x[n]) = 1/ratio if x[n] > threshold

 

Source Code

Compression.txt

Compression.csd

(.csd files can be viewed with Notepad or any text editor)

 

Example Audio Clips

Original unprocessed signal

Original

Compressed signal

Compression

Limited signal

Limiter

 

Aurally, it is difficult to tell the difference between these sound clips. Differences in the output levels can be observed by analyzing the output of the csound compiler. The original signal peaks at 40957.5, well past the maximum sample value of 32767. The compressed signal is reduced to 33099.23688, still slightly above the maximum value. The limited signal is reduced to 29989.523927, below the maximum value.

 

Original: peak CH 1: 40957.500000  (written: 1.000000) at 131575

 

Compressed: peak CH 1: 33099.203688  (written: 1.000000) at 132055

 

Limited: peak CH 1: 29989.523927  (written: 0.915236) at 132055

 

References

Lehman, Scott (1996). Effects Explained. Harmony Central.  Retrieved 6/04 from

http://www.harmony-central.com/Effects/effects-explained.html

 

Mikelson, Hans (2000). Modeling a multieffects processor in Csound. In Boulanger, Richard (2000), The Csound book (pp 575-594). Cambridge, MA: MIT Press.

 

Schindler, Allan. (1998). Eastman Csound tutorial.  Eastman School of Music. Retrieved 6/04 from

http://www.esm.rochester.edu/onlinedocs/allan.cs/

 

Vercoe, Barry. (1992). The public Csound reference manual, version 4.16. MIT Press.  Retrieved 6/04 from http://www.lakewoodsound.com/csound/hypertext/manual.htm

 

Zolzer, Udo. (2002). Digital audio effects. West Sussex, England: Baffins Lane.