[music-dsp] Soft-knee algo & implementation

Steve Harris S.W.Harris at ecs.soton.ac.uk
Sun Jan 4 14:33:01 EST 2004


On Sun, Jan 04, 2004 at 04:42:24 -0500, Citizen Chunk wrote:
> Soft is a parameter that controls the width of the soft-knee. at Soft = 
> 0, the knee is nonexistent, and hence, "hard". at Soft = 1, the knee 
> extends from the threshold^2 (in dB, this would be double the 
> threshold) to some intersection above the threshold. i can't seem to 
> figure out a formular for this intersection, which would be my 
> softThreshHi.

FWIW, I use:

	  rs = (ratio - 1.0f) / ratio;

	  if (env <= knee_min) {
	    gain = 0.0f;
	  } else if (env < knee_max) {
	    x = -(threshold - knee - lin2db(env)) / knee;
	    gain = -knee * rs * x * x * 0.25f;
	  } else {
	    gain = (threshold - lin2db(env)) * rs;
	  }

(gain is in dB's, knee is the knee radius in dB's)

I dont remember exactly how I came to that, but if I remember correctrly
its continuous for env = knee_min and env = knee_max, its a simple
quadratic expression.

- Steve



More information about the music-dsp mailing list