This lib is considered to be used as a sensor's calibration program. Calibration with Spline Interpolation might be useful in the case that you want some model expressing relationship such like between a value of physical quantity and your sensor's voltage, but you cannot estimate a model such as liner, square, cubic polynomial, or sine curve. This makes (Parametric) Cubic Spline Polynomial Model (Coefficients of the polynomial) from some sample plots(e.g. sets of (value, voltage)). The inverse function (x,y)->(y,x) has been implemented so as to get analog data (not stepping or leveled data).

Fork of TRP105F_Spline by Akifumi Takahashi

Revision:
9:1903c6f8d5a9
Parent:
8:e7d451bb4fd4
Child:
13:9a51747773af
--- a/CubicSpline.h	Thu May 26 04:50:45 2016 +0000
+++ b/CubicSpline.h	Sun May 29 09:14:54 2016 +0000
@@ -15,7 +15,7 @@
 #include "mbed.h"
 #include <cmath>
 #include <complex>
-
+#include <vector>
 
 //  Vector Element Type
 typedef struct {
@@ -71,7 +71,12 @@
         const double* arg_sampled_t,
         const double* arg_sampled_ft,
         /*-*/ double* arg_C[4],
-        const unsigned int arg_num = _Sample_Num
+        const unsigned int arg_num
+    );
+    void    _makeModel(
+        const double* arg_sampled_t,
+        const double* arg_sampled_ft,
+        /*-*/ double* arg_C[4]
     );
     //
     //  For calculation
@@ -91,8 +96,22 @@
     //
     //  For debug
     //
-    void    _printOutData(unsigned short    *arg, int num, char* name);
-    void    _printOutData(Vxyt              *arg, int num, char* name);
-    void    _printOutData(double            *arg, int num, char* name);
+    void    _printOutData(
+        const unsigned short*   arg,
+        const int               num,
+        const char*             name);
+    void    _printOutData(
+        const Vxyt*             arg,
+        const int               num,
+        const char*             name);
+    void    _printOutData(
+        const double*           arg, 
+        const int               num,
+        const char*             name);
+    void    _printOutDataCouple(
+        const double*           arg1,
+        const double*           arg2,
+        const int               num,
+        const char*             name);
 };
 #endif
\ No newline at end of file