I stumbled upon a problem.
Every time I average data on my channel it is usually about 2 times smaller
and have a great tendency to have peaks. My raw data has no spikes, or wrong samples.
It happens on almost all of my fields. If you average on field 1 it looks similar, but is actually 2x smaller than original :/
Can I fix it, or do I need to make a new channel?
Some of the fields in your channel are updated more frequently than others. When this happens, an empty value is written to the fields that aren't updated, and the average includes the zero values. The spikes are due to periods when there are relativity fewer nulls than there were recently, and the average jumps.
I would suggest using a MATLAB analysis to filter your data. The MATLAB analysis will read a value (possibly with thingSpeakRead ) and write it to a new channel (with thingSpeakWrite)if it is not a NULL or zero value. Then the new channel averaging will work appropriately.
You can use the REACT App to trigger a MATLAB analysis that filters every time new data is entered.
Alternatively, you could consider writing each measurement that updates at a different frequency to different channels. You can use another MATLAB analysis to loop through all the values in your old channel and write them to the new channel without the NULL values.
I recently added one field updated by MATLAB analysis which updates at different frequency. I think it might have been a mistake.
Will the problem disappear (in new samples) if I remove this field and let it collect more samples?
All my others fields are updated at once, there were no problems before my messing with MATLAB.
Not a mistake, but an opportunity to improve your chops as a ThingSpeak guru. 🙂 I suggest that you make the output of the MATLAB analysis write to a different channel instead of field 7, then you will still have the analytics you wanted along with the behavior of the averaged ThingSpeak plots that you want. Once the empty values aren't written to the other fields for as many measurements as you are averaging, the average display will again act as you predicted. You can export your data on the private view (it will only export what you have it set to show) or using the data export tab on the far right. From what I saw in your data, only field 7 seemed out of sync with the others.
Most Users Ever Online: 114
Currently Browsing this Page:
Guest Posters: 1
Administrators: Hans, lee