On 7/15/14 7:13 PM, zhiguang e zhang wrote:
Another one here interested in how the knee was implemented.
On 7/15/14 7:59 PM, Jihad Ibrahim wrote:
The knee width in the DSP System Toolbox Dynamic Range Compressor is based on 
the following reference (available online):
'Digital Dynamic Range Compressor Design - Tutorial and Analysis', Giannoulis, 
Dimitrios; Massberg, Michael; Reiss, Joshua D., JAES Volume 60 Issue 6 pp. 
399-408; June 2012


i was sent a copy of the paper and my recollection was confirmed.

using the same convention of notation i have below (with the smooth bended knee), the soft-knee depicted in the paper would go like this:


            {  x                                   x - x0 < -4b/(1-r)
            {
   f(x)  =  {  x - b*(1 + (1-r)/(4b)*(x-x0))^2    |x - x0| <  4b/(1-r)
            {
            {  x0  +  r*(x-x0)                     x - x0 >  4b/(1-r)


and the dB gain function is the same

   g(x)  =  f(x) - x


that agrees with the asymptotes of the f(x) below and it agrees at the threshold f(x0). again, the quadratic knee above has discontinuities in the 2nd derivative at two places. but the 0th and 1st derivatives are continuous everywhere.


as an alternative, here is a compressor curve (in the "log amplitude" or dB domain) that is asymptotically the same, but is smooth in all derivatives:

    f(x)  =  x  -  b*log2( 1 + 2^( (1-r)*(x-x0)/b ) )

the slope at x=0 is about 1, the slope for large x is about r (so the compression ratio is 1/r), the bend or knee is at x=x0>0. the vertical dimension of the knee is b, so a softer knee means a larger b.

    f(x0) =  x0 - b

the gain function (in log amplitude) is

    g(x)  =  f(x) - x   =   -b*log2( 1 + 2^( (1-r)*(x-x0)/b ) )

    g(x0) =  -b

the (log amplitude) gain for x<<x0 is about 0 (dB) and the gain for x>>x0 is

    g(x)  approx=  (r-1)*(x-x0)

just in case someone wants an adjustable soft knee and doesn't want to deal with breakpoints. dunno how one would want to implement the exponential and log functions, but if memory isn't a problem i would just put g(x) into a good-sized table and linearly interpolate. one could also implement g(x) in the linear domain so that there would be no need to convert the amplitude envelope into the log-amplitude domain to apply to g(x).


--

r b-j                  r...@audioimagination.com

"Imagination is more important than knowledge."



--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp

Reply via email to