I had a go with using a DC filter to remove the bias and here are the results. First. here is the simulated performance of the current Pedometer with RAW_THRESHOLD = 17:
//Exponential Moving Average DC removal filter alpha = 1/NSAMPLE
int DCFilter_sample_avg_total = 8192*NSAMPLE;
int DCFilter(int sample) {
DCFilter_sample_avg_total += (sample - DCFilter_sample_avg_total/NSAMPLE);
return sample - DCFilter_sample_avg_total/NSAMPLE;
}
@HughB It appears that the accuracy gets worse on your shorter walks and better on your longer walk with this approach.
The main advantage is that it deals with the Mr Ploppy problem even if you set the threshold as low as 10.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I had a go with using a DC filter to remove the bias and here are the results. First. here is the simulated performance of the current Pedometer with
RAW_THRESHOLD = 17
:Now here are the results with using a DC Filter and reducing the threshold to 15:
NSAMPLE is a parameter of the filter:
@HughB It appears that the accuracy gets worse on your shorter walks and better on your longer walk with this approach.
The main advantage is that it deals with the Mr Ploppy problem even if you set the threshold as low as 10.