googlearchive / science-journal

Use the sensors in your mobile devices to perform science experiments. Science doesn’t just happen in the classroom or lab—tools like Science Journal let you see how the world works with just your phone.
https://sciencejournal.withgoogle.com/
Apache License 2.0
509 stars 132 forks source link

feature request: autoscaling scales also down again and/or fixed range for external devices #4

Closed berndporr closed 7 years ago

berndporr commented 8 years ago

screencapture.zip

Would it be possible to add different autoscale options? Here is a simple example (as you know I'm heavily into bio): imagine you want to record the tremor on somebody's hand which are tiny changes of the acceleration. Then suddenly the person moves the hand a bit then the signal goes through the roof (see video above where I held the Attys first still and then shook it violently and then kept it still again). The same problem is with ECG or other biosignals which are tiny. A fridge next door might cause a massive spike so that the ECG trace would vanish for the remainder of the experiment. It would be great if you could add a "reset" button for the autoscaling or perhaps a gentle re-scaling towards the initial scales at a timescale of a couple of seconds and/or the width of the plotwindow. I guess you'd want to have such functionality at a minimum and transparent to the user. As a more local fix (and leave it to the external developers) I'd be happy if just the observer class had an optional argument where the scaling could be controlled and then the external device could either leave it to ScienceJournal or could take care of the scaling by itself. For example an ECG will always be about 1mV so no need to scale or an EEG at 100uV.

dsaff commented 8 years ago

These are great suggestions. One trick is that if you tap the current sensor icon in the sensor tab drawer, it does reset the scale.

Allowing the API sensors to set the scale is a very interesting idea. Do you expect that you would use it if it were provided?

berndporr commented 8 years ago

Thanks. I should have tried tapping the current sensor. I'd definitely use the feature to set the scale and especially for the analogue inputs I'd like to provide different scalings depending on the applications. ECG for example would do best with a fixed scaling of +/- 2mV (ECG is always around 1mV) but for certain applications I'd love to write a dynamic scaling which is pretty much in the spirit of this app to have it as userfriendly/easy to use as possible. Especially for the analogue inputs that would be really good to have customs ranges which intelligently adadpt so that for example spurious spikes for would be ignored for the scaling. I def would use it.

berndporr commented 8 years ago

ecg Just to illustrate it with my ECG (just added custom config for biosignals). I sat still, pressed REC and then at the end I pressed REC again to stop it but because I reached out my finger to press REC I created some nasty artefacts. Hard to avoid when recording it from myself. In this case limiting it to +/- 2mV would be great. I'm aware that this would saturate the min/max readings in this case. Perhaps a region to pinch with both fingers would be great also to measure time.

dsaff commented 8 years ago

FYI, we're planning in a release soon to support cropping of trials, so that you could snip out the early and late invalid data.

berndporr commented 8 years ago

Excellent. That would be fantastic.

berndporr commented 8 years ago

Great that you guys have cropping in your roadmap. Still I think it would be great if the y scaling could be controlled. I was wondering if one could pinch and zoom into the data while it's recording so that one could evaluate if it's worth continuing a trial. I think it's already there. I can pinch it and it scales up a bit but it bounces back. I know I can reset the recording with a new scaling which is good but on a tablet that would be fun being able to use your fingers to zoom in. Many interesting signals are tiny (not just bio-signals but for example temperature from a thermocouple) and from the educational aspect that would be great to see how tiny they are and then zooming in. Also artefacts are often not just at the start / end (the fridge can go off any time) so that even cropping won't prevent the y-scaling getting squashed. Perhaps pinch/zoom is better than expecting the external drivers to provide some dynamic scaling info but rather having the student doing it and experiencing the size of a signal? I've just shown a student her ECG first on full scale (=flat line) and then we zoomed in until it was visible.

dsaff commented 8 years ago

Pulled out a separate feature request for zooming Y. How about we try that first, and see if it resolves most of the concerns? Thanks.

berndporr commented 8 years ago

Sounds good to me. I think in combination with the x cropping in post that should work resolve most of the concerns indeed.

dsaff commented 7 years ago

OK, sounds like cropping + Y zooming satisfies this request, so closing this particular issue. Feel free to re-open if I've misinterpreted!