IDMf - Electronic Music & Production Forum - IDMforums.com

IDMf - Electronic Music & Production Forum - IDMforums.com (http://www.idmforums.com/index.php)
-   Modular software & programming (http://www.idmforums.com/forumdisplay.php?f=167)
-   -   Compressors/Limiters (http://www.idmforums.com/showthread.php?t=83080)

GhostAddict 14-06-2011 11:30 PM

Compressors/Limiters
 
The math behind compressors/limiters.
I want to make a multiband compressor like the one in FLstudio for use in my plugins.
Does anyone have any idea the math behind compressors.
I understand the basic function of threshold,compression, gain, and the standard knobs on a compressor. but im interested in the math.
like thershold at -6db with compression of 3/1 and gain of 2 times would look like
(input*2)
if input>-6db
then input-(-6db)=x
x*1/3
input+x

Is this close to how it should look like?

Gotthavok 17-06-2011 09:11 AM

Re: Compressors/Limiters
 
i'd suggest chatting up the plugin developers @ Smartelectronix for that kind of info

DJWreck 14-11-2011 08:26 PM

Re: Compressors/Limiters
 
I'm not a coder by any means but have studied maths and engineering a bit.

I think you are treating it as a linear function with the quick example given but dB is a logarithmic expression so all the calulations have to be dealt with in a non-linear way. dB measurements are measured using a logarithmic system against a reference which changes depending on which system is being used.


eg. SPL - sound pressure level is caluculated using:

SPL = 20* log (Prms/Pref)

log is base 10, Prms is the pressure (Pa) of the measured sound & Pref is the reference pressure (Pa) which is 20 uPa

This is only an example, there are other systems of expression, like sound power level where powers are replaced by Watts. The *20 is replaced by *10 and the reference is 10E-12 W.

Sound power level = 10 * log (Prms/Pref)

using the above mentioned power reference, Prms is again the measured power of the signal.

If you convert from dB to a power or pressure type linear value, you can then add and subtract them together/from each other.

This is because human hearing does not work in a linear way. A sound that is played twice as loud in terms of power is not perceived to be twice as loud. This would limit our dynamic range of hearing, loud sounds would be crippling and we wouldn't hear quiet sounds well. Instead dBs are used as they closer repsresent how our ear/brain system compares sound levels.

It's been a few years since I studied all this, treat it as a guide and not as gospel.

Hope it helps and good luck.




Quote:

Originally Posted by GhostAddict (Post 702431)
The math behind compressors/limiters.
I want to make a multiband compressor like the one in FLstudio for use in my plugins.
Does anyone have any idea the math behind compressors.
I understand the basic function of threshold,compression, gain, and the standard knobs on a compressor. but im interested in the math.
like thershold at -6db with compression of 3/1 and gain of 2 times would look like
(input*2)
if input>-6db
then input-(-6db)=x
x*1/3
input+x

Is this close to how it should look like?



All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.