Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
For example, if the temperature of a room from 0C to 10C is measured, the following data shows measurements which are neither accurate nor precise, accurate, precise, and both.
Measured T vs Actual T
Zero-Based Calibration: Define a linear map which passes through the origin and minimizes the mean squared error: This is useful in that it forces the output to zero when the measurement is zero. y = ax
Accurate
Precise
Calibration:
Calibration improves the accuracy and precision of a sensor by defining a mathematical relationship between what you measured and what the reading should be. For example, the third plot above could be improved by subtracting a constant from the measured temperature. This would be one type of calibration. In general, calibration attempts to map the measurement to its ideal value by some function: y = f (x ) where 'x' is the measured quantity and 'y' is an improved estimate of what you're trying to measure. Different functions are as follows:
Linear Calibration: Try to fit a straight line to the data: y = ax + b a,b free
1-1
So the best you can do is T 0.0006143R Checking this for accuracy and precision...
Yest=A*X; [Y,Yest] ans =
Not surprisingly, zero-based calibration is fairly poor. Solution (Least Squares): Express the problem as Y = XA where Y is the output, X is a known function matrix, and A is a constant but unknown matrix. The least squares solution for A will then be A (X T X ) X T Y The estimated output is then Y = XA and the error in this estimate is E = YY So T 0.0016R + 43.6790 Checking this calibration scheme for accuracy and precision...
Yest=X*A; [Y,Yest]
1
Linear Calibration
Next try T aR + b
% Linear X=[R,R.^0]; A=inv(X'*X)*X'*Y A = -0.0016 43.6790
Zero-Based Calibration:
First, set this up as Y = AX
R=[29490,18790,12260,8194,5592]'; T=[0,10,20,30,40]';
ans = 0 10.0000 20.0000 30.0000 40.0000 -3.2961 13.7481 24.1499 30.6267 34.7714
1-2
Polynomial Calibration:
The data looks like a quadratic function. relationship like T aR 2 + bR + c may work better. In MATLAB
% polynomial X=[R.^2,R,R.^0]; A2=inv(X'*X)*X'*Y Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.743875e-019 A2 = 0.0000 -0.0038 58.0711
Hence, a
Again, the accuracy of higher-order polynomials is still zero. The precision is better, however. Plotting R vs. Y and its estimates gives the following 1-3
This looks somewhat a polynomial. another term may make sense: T = aR 2 + bR + c This residual then is
Hence, adding
At this point, the residual is starting to look like noise. Including a third term is probably not warranted.
1-4