Linear to logarithmic

I am trying to generate a logarithmic output from a linear input. This is to drive the PWM output of an LED so I get a better response to brightness control.

The input signal is 0.0 to 1.0 and the output would be the same range, only logarithmic.

Anyone done this before? I’ve tried various maths on this but I never end up with a proper curve. It ramps up too early.

i have done something with RGB Leds, setting the color and intensity based on the sensitivity of the human eye. Maybe you can get some ideas at [url]Manipulating colors in .NET - Part 1 - CodeProject

What constitutes too early?