Main Archive Specials Wiki | FAQ Links Submit Forum

Soft saturation

Type : waveshaper
References : Posted by Bram de Jong

Notes :
This only works for positive values of x. a should be in the range 0..1

Code :
x < a:
f(x) = x
x > a:
f(x) = a + (x-a)/(1+((x-a)/(1-a))^2)
x > 1:
f(x) = (a+1)/2


Added on : 09/09/05 by graue[ AT ]oceanbase[ DOT ]org
Comment :
This is a most excellent waveshaper.

I have implemented it as an effect for the music tracker Psycle, and so far I am very pleased with the results. Thanks for sharing this knowledge, Bram!

Added on : 11/03/06 by brobinson[ AT ]toptensoftware[ DOT ]com
Comment :
I'm wondering about the >1 condition here.  If a is 0.8, values <1 approach 0.85 but values >1 are clamped to 0.9  (there's a gap)

If you substitute x=1 to the equation for x>a you get: a+((1-a)/4) not (a+1)/2

Have I missed something or is there a reason for this?

(Go easy I'm new to all of this)

Added on : 23/08/06 by kibibu[ AT ]gmail[ DOT ]com
Comment :
Substituting x=1 into equation 2 (taking many steps)

f(x) = a + (x-a)/(1+ ((x-a)/(1-a))^2)
     = a + (1-a)/(1+ ((1-a)/(1-a))^2)
     = a + (1-a)/(1+ 1^2)
     = a + (1-a)/2
     = 2a/2 + (1-a)/2
     = (2a + 1 - a) /2
     = (a+1) / 2

Added on : 24/08/06 by musicdsp[at] Nospam dsparsons[dot]co[dot]uk
Comment :
You can normalise the output:

This gives a nice variable shaper with smooth curve upto clipping at 0dBFS

Add your own comment
Comments are displayed in fixed width, no HTML code allowed!


Are you human?

Site created and maintained by Bram
Graphic design by line.out | Server sponsered by fxpansion