# Is this algorithm an example of exponential interpolation?

We have an algorithm for calibrating an O2 (oxygen) sensor I'm trying to get my head around. The original author is gone and away and the whole thing seems to generally work, but I'd like to verify that it's working correctly. (And testing it at known points is uh, hard.)

Here it is:

$$TargetValue = MeasuredValue * \frac{ln(1-TargetPercentage)}{ ln(1-MeasuredPercentage)}$$

We have a MeasuredValue we get when we put O2 gas across our sensor at 20%, MeasuredPercentage. But we actually want a reading at 10% O2 gas, TargetPercentage. Which, according to the algorithm when the target is 0.1 and the measured is 0.2, means we multiply all those readings by 0.47.

We use the 'MeasuredValue' as a calibration point so the variance across O2 sensors is removed. The code assumes a calibration point of 10% O2, while the actual gas we feed it consists of 20% O2.

The algorithm is pasted all over the place, but the target and measured percentages are the same, and it all cancels out. Except for at 20%, which is "adjusted" to 10%. In which case the algorithm simplifies to $$TargetValue = MeasuredValue*0.47$$

The question becomes why 0.47?

This O2 sensor's output follows a curve. As the O2 increases it outputs higher voltage at an exponential rate. This looks like the author is trying to perform exponential interpolation to take a value they got at 20%, and shift it down an exponential curve to 10%. But it's not exactly the same as what I've been able to research, like:

$$y = exp[ln(y_{i-1}) + [ln(y_i)-ln(y_{i-1})]\frac{x-x_{i-1}}{x_i-x_{i-1}}$$

I can't see how this algorithm would transform into the one that's being used.

Is this an algorithm for exponential interpolation?
If not, what is it doing?

-

$$v(p) = k \ln{(1-p)}$$
The measured values provide the value of $k$ ($0.47$ in your example), and you take it from there for $p=0.1$. I don't see a relation between this and any sort of interpolation. For small $p$, perhaps you can get away with linear interpolation, but that's about all.