- #1
Lord Crc
- 343
- 47
- TL;DR Summary
- Want to classify a variable-length sensor signal into multiple categories.
I got a gesture sensor module that produces a signal per event. The each signal is a set of regularly sampled readings from four photodiodes. The number of samples per event can be very different, from around 20 up to over 100, and each sample value is essentially the measured brightness.
Initially I'd like to focus on a pair of diodes, so I can detect "left to right" and "right to left" movement. In addition I'd like to be able to if the classification is uncertain. A "left to right" signal will be characteristic in that the left photodiode will measure higher brightness before the right photodiode, and reduced brightness before the right diode. However the absolute levels will vary between events, and the relative levels will often vary between left and right diode (if the hand does not move perpendicular to the sensor for example).
As an example, here is some data for three events. The values here are differential values, ie the left sample value minus the right sample value.
The first is a relatively clear "left to right":
Second is a faster yet fairly decent "right to left":
The last an even faster but now more ambiguous "right to left":
I'm ok with this last one being classified as "uncertain".
I've had a few statistics classes at uni way back, but we never got around to stuff like this. I've tried to do some searching but haven't yet found anything that I could recognize would be a good fit.
My initial thought was to do something fairly low-tech and simply expect N consecutive samples that are "fairly high", followed some time later by some "fairly in the middle", finally followed by some "fairly low". But it seems a bit fragile and noise prone.
Another idea that I came up with during searches was to try to fit a cubic polynomial to the normalized differential values and then use some classifier like a perceptron on the resulting coefficients. No idea if that's completely rubbish or not though.
As a final twist, this will be running on a microcontroller with limited memory, so big matrices or lots of heavy computations etc might be an issue.
Anyone got some pointers or ideas?
Not sure if this is the right place, so mods feel free to move.
Initially I'd like to focus on a pair of diodes, so I can detect "left to right" and "right to left" movement. In addition I'd like to be able to if the classification is uncertain. A "left to right" signal will be characteristic in that the left photodiode will measure higher brightness before the right photodiode, and reduced brightness before the right diode. However the absolute levels will vary between events, and the relative levels will often vary between left and right diode (if the hand does not move perpendicular to the sensor for example).
As an example, here is some data for three events. The values here are differential values, ie the left sample value minus the right sample value.
The first is a relatively clear "left to right":
17, 13, 18, 15, 17, 19, 16, 17, 21, 22, 18, 18, 17, 20, 20, 19, 18, 17, 15, 15, 16, 16, 19, 15, 15, 15, 14, 6, 13, 5, 4, 2, 3, 1, -7, -2, -5, -10, -9, -16, -15, -12, -16, -15, -17, -19, -22, -22, -20, -22, -20, -26, -22, -21, -23, -25, -23
Second is a faster yet fairly decent "right to left":
-27, -22, -23, -18, -20, -11, -13, -12, -7, -3, 3, 4, 10, 15, 19, 20, 25, 24, 20, 19, 20, 15, 7, 0, 0, -7, -4
The last an even faster but now more ambiguous "right to left":
-12, -14, -13, -14, -16, -18, -19, -14, -16, -17, -15, -14, -17, -10, -14, -14, -13, -9, -10, -8, -7
I'm ok with this last one being classified as "uncertain".
I've had a few statistics classes at uni way back, but we never got around to stuff like this. I've tried to do some searching but haven't yet found anything that I could recognize would be a good fit.
My initial thought was to do something fairly low-tech and simply expect N consecutive samples that are "fairly high", followed some time later by some "fairly in the middle", finally followed by some "fairly low". But it seems a bit fragile and noise prone.
Another idea that I came up with during searches was to try to fit a cubic polynomial to the normalized differential values and then use some classifier like a perceptron on the resulting coefficients. No idea if that's completely rubbish or not though.
As a final twist, this will be running on a microcontroller with limited memory, so big matrices or lots of heavy computations etc might be an issue.
Anyone got some pointers or ideas?
Not sure if this is the right place, so mods feel free to move.