Hi All Trying to use pchip to process sensor data from raw digital values. Seems to work fine when the raw values are within the range of calibration values used us inputs to pchip. However, when raw values are smaller than those values used to calibrate the sensor the output is unexpected. Using the example for pchip from Mlab help:
x = -3:3; y = [-1 -1 -1 0 1 1 1]; t = -3:.01:3; p = pchip(x,y,t);
pchip (x,y,-4); ans = -1 (as expected)
However, if change y to:
y = [-1 -0.98 -0.94 0 0.94 0.98 1];
pchip (x,y,-4); ans = -0.9933
Why do answers for x values <-3 increase? I would expect them to linearly decrease i.e. pchip (x,y,-4); ans = -1.02
Thanks in advance
Best Answer