Time-based Interpolation of Sensor Data / Resampling

EDT’s Interpolate function can be used to resample data from one or more sensors to a custom defined time-base (a defined, constant delta between the datetime values). This works great splicing weather data to sensors or different sensors together that sample at different rates. I did this with two EXCEL sheets in a common workbook. The “Null” one provides the time-base I ultimately wanted AND the start-time which the re-sampling starts at-- the data is just a constant value that is not processed - all that matters here is the regular time-base covering the period we are interested in resampling across.

The data is provided by a second sheet that has single or multiple sets (an example with 2 sets of data is shown). NOTE: The timebase and the sensor data was set to start at the same point so everything aligned. Depending on use, one may have to manually interpolate the first point to line it up with the timebase and other data points to avoid extrapolation issues.
Capture2

Using EDT, the workflow is shown here:
(Showing the JS logic - corresponding column name is the only change between each JS function)

(Final Output)

Note: if you do not want to use a custom time-base and just want one sensor to match another’s time base, this turns into a simpler exercise where no “NULL” time-base data is used and the first sensor supplies the common time-base for all interpolated sensors (2 total are shown here in this example). The second sensor will be interpolated to this sensor’s timebase and the first sensor will have no interpolation performed as it supplies the timebase (nothing to interpolate to). An extended example is also provided here: https://www.easydatatransform.com/merge_timestamped_data.html

1 Like

Thanks for sharing this on the forum!

1 Like