Map a value on logarithm function
in
Programming Questions
•
5 months ago
Hi folks,
I would like to map a number with a logarithm scale. But I don't know how to do.
It's data from seismometer, the range is veeeeery large. Between -10E6 and 10E6, but 99% of time it stay arround -10E2 and 10E2. So I would like apply to the signal a log function to increase sensibility on middle of the range and decrease on extremity.
For the moment I have a linear mapping : pos = map (signal, -10E6, 10E6, 0, height);
And I would like a kind of logarithm mapping (but there is negative values, I don't know how to deal with that).
Can you help me ?
Thanks a lot !
P.S. for moderators : I post this message in the wrong place (general discuss) and less clear yesterday, it was late, sorry.
I would like to map a number with a logarithm scale. But I don't know how to do.
It's data from seismometer, the range is veeeeery large. Between -10E6 and 10E6, but 99% of time it stay arround -10E2 and 10E2. So I would like apply to the signal a log function to increase sensibility on middle of the range and decrease on extremity.
For the moment I have a linear mapping : pos = map (signal, -10E6, 10E6, 0, height);
And I would like a kind of logarithm mapping (but there is negative values, I don't know how to deal with that).
Can you help me ?
Thanks a lot !
P.S. for moderators : I post this message in the wrong place (general discuss) and less clear yesterday, it was late, sorry.
1