Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

Calibrate threshold #37

Open
roccomuso opened this issue Jan 21, 2016 · 2 comments
Open

Calibrate threshold #37

roccomuso opened this issue Jan 21, 2016 · 2 comments

Comments

@roccomuso
Copy link

I noticed that threshold needs to be adjusted from device to device. There isn't a way to calibrate it?

@alexgibson
Copy link
Owner

If yourself or anyone else can find a reliable way to do this pull requests are welcome

@davidje13
Copy link

You take a direct difference between accelerations (https://github.com/alexgibson/shake.js/blob/master/shake.js#L100) without accounting for the sampling frequency. That means that any variance in sampling frequency will change the effective threshold. You should at a minimum divide the difference by e.interval, and ideally perform smoothing on the values to simulate a consistent low sampling rate.

Those changes should make this perform near-identically on all devices.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants