This signal has PEAKs. When using PEAK detection it means that the step state machine will get called from very small movements - EG when sat on a sofa.
I have flashed 2.10.13 and am testing against 3.11.
15 mins sat on the sofa the FW has done 13 steps and 3.11 has done 6 steps.
The difference is that the FW has no minimum raw threshold that must be reached before
we take the filter output.
3.11 has this bit of code :
if (raw_clipped > RAW_THRESHOLD || raw_clipped < -1*RAW_THRESHOLD) {
if (active_sample_count < N_ACTIVE_SAMPLES)
active_sample_count++;
if (active_sample_count == N_ACTIVE_SAMPLES)
gate_open = true;
} else {
if (active_sample_count > 0)
active_sample_count--;
if (active_sample_count == 0)
gate_open = false;
}
if (!gate_open)
accFiltered = 0;
What this code is doing is saying is the raw m value bigger than room noise for more than 3 samples.
The raw threshold is set to +-10. And to take the filter output the ABS(input) must be greater than the threshold (10) for about 1/4 of a second. This is necessary otherwise PEAKs in the chip noise or noise from the ground get passed into the state machine. We want to definitely moving before we start calling the state machine.
I'm convinced this concept is needed AND it can also be one of the parameters we use to TUNE the step counter against the accellog recordings.
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.
Why there need to be a threshold on the raw M input
Place the watch on a table and you will still see some raw m signal from the accelerometer:
This signal has PEAKs. When using PEAK detection it means that the step state machine will get called from very small movements - EG when sat on a sofa.
I have flashed 2.10.13 and am testing against 3.11.
15 mins sat on the sofa the FW has done 13 steps and 3.11 has done 6 steps.
The difference is that the FW has no minimum raw threshold that must be reached before
we take the filter output.
3.11 has this bit of code :
What this code is doing is saying is the raw m value bigger than room noise for more than 3 samples.
The raw threshold is set to +-10. And to take the filter output the ABS(input) must be greater than the threshold (10) for about 1/4 of a second. This is necessary otherwise PEAKs in the chip noise or noise from the ground get passed into the state machine. We want to definitely moving before we start calling the state machine.
I'm convinced this concept is needed AND it can also be one of the parameters we use to TUNE the step counter against the accellog recordings.