Gaussian / Bell Curve

Hello,

I am curious what the most space efficient way to implement a Gaussian/Bell curve function would be? I need to be able to implement and manipulate halves of Gaussians, for instance ramp up to a value in a Gaussian fashion, where I can set the parameters, and then ramp back down from a maximum at some later time. Any ideas what the best way to do this would be or wise suggestions?

Thanks!

LP

PS. I am also interested in implementing a few other quadratic functions as time goes on, (exponential, squared, and possibly a cubic function) if there are any tips for that. I wanted to try to avoid including a giant library with unnecessary functions as I am running out of space in my current code.

Thanks!

Can you be a bit more precise about what you want to do?

I do not understand what you are wanting to do when you say:-

I need to be able to implement and manipulate halves of Gaussians, for instance ramp up to a value in a Gaussian fashion, where I can set the parameters, and then ramp back down from a maximum at some later time.

What are you ramping up?

See this:-

I am curious what the most space efficient way to implement a Gaussian/Bell curve function would be?

The function can be written in one line, so how is that a problem? What else have you tried?

Mike,

Sorry for not being a little more specific. I'd like to output a voltage and increase this voltage following a Gaussian with respect to time, then after reaching some max value for a set amount of time I'd like to reduce voltage following the other side of the Gaussian.

JRemington,

Code please?

Thanks for the replies.

Regards,

LP

float value=exp(-0.5*pow((x-mean)/sigma,2.));  //you will want to choose mean, sigma and scale the output value appropriately

Excellent, thanks JRemington!