Thingspeak channel has fields with different sample rates - what is best way to deal with this?
Show older comments
Some fields come in to a channel from a device at intervals of 5 minutes, whilst others come in from another device at intervals of 15 minutes. The channel (consisting of several fields) has only one time stamp array. When data comes from different devices and/or at different rates, this gets messy. Lots of timestamps have no data for some fields, which makes processing more difficult and it also limits how much data can be read - eg the 8000 data point limit means you can't read as much real data as you could for a slow channel if it had its own slow timestamp - instead it has the fast timestamp and lots of wasted "empty" readings.
Ideally it would be nice if each field (or each group of fields from one device) would have their own timestamp. Are there any methods or tricks to deal with this issue?
Answers (1)
Chetan
on 25 Aug 2023
0 votes
Hi Steven!!
As per as my understanding you are dealing with multiple fields coming from multiple devices at different rates.
There are several methods and tricks that can be used to address the issue:
- Interpolation: Use interpolation techniques to estimate values between known timestamps for fields that have different arrival rates.
- Resampling: Resample the data from different devices to a common time based by selecting a specific time interval and adjusting the data to fit within that interval.
- Time Alignment: Shift the timestamps of one device to align with the timestamps of another device based on a known time difference between them.
- Separate Timestamp Arrays: Modify the data acquisition process to include separate timestamps for each field or group of fields from one device.
You can refer the following article for more info & sample code:
- interpolating data to different sample rate - MATLAB Answers - MATLAB Central (mathworks.com)
- how to sampling the signal in order to match the two signal? - MATLAB Answers - MATLAB Central (mathworks.com)
Hope it helps!
1 Comment
Steven Grobler
on 29 Aug 2023
Categories
Find more on Prepare and Analyze Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!