Polynomial Impulse
Another impulse function that doesn't use exponentials can be designed by using polynomials. Use
k to control falloff of the function. For example, a quadratic can be used, which peaks at x = sqrt(1/k).
float quaImpulse( float k, float x )
{
return 2.0*sqrt(k)*x/(1.0+k*x*x);
}
You can easily generalize it to other powers to get different falloff shapes, where
n is the degree of the polynomial:
float polyImpulse( float k, float n, float x )
{
return (n/(n-1.0))*pow((n-1.0)*k,1.0/n)*x/(1.0+k*pow(x,n));
}
These generalized impulses peak at x = [k(n-1)]
-1/n.