S
S
shadrap2020-02-24 22:40:38
C++ / C#
shadrap, 2020-02-24 22:40:38

How to write an algorithm for calculating an almost linear correction factor for sensor readings?

Hello.
There is a sensor that gives indicators in "parrots" (capacity) cur_cap, the dependence of these readings on the sensor supply voltage (there is a slight drift) with the reference cur_cap has been empirically established. We got two dependent data arrays int cap(x1,x2,.....) and volt(y1,y2,.....) . How to write a function to correct sensor readings depending on voltage using array data? Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Armenian Radio, 2020-02-24
@gbg

Enjoy - Lagrange Interpolation Polynomial

D
dmshar, 2020-02-25
@dmshar

If I understood correctly.
There are two sets of data X(voltage), Y(capacitance). We understand that Y is measured with some error.
It is necessary to find a function F(X), such that Ф(Ymod-Y) -- in fact, the error between the measured (Y) and calculated (Ymod) values ​​at given points from X -- would be in some sense optimal (for example - minimum).
F () - in the simplest case, a linear function, in more complex cases, not necessarily.
If so, then we have the classical problem of building a regression model. Having such a model, it is possible for arbitrary x to "predict" the expected value of y.
If by Y we mean not the values ​​themselves (capacity), but the corrections that you make at given points X, then the regression model constructed in a similar way will "predict" the correction that must be taken into account at an arbitrary point x.

U
U235U235, 2020-02-25
@U235U235

MNC?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question