Android Accelerometer Profiling -


i have written simple activity sensoreventlistener sensor.type_accelerometer.

in onsensorchanged(sensorevent event) pick values in x,y,z format , write them on file.

added x,y,z label, label specific activity performing. x,y,z,label

like obtain activity profile. have suggestions on operations perform after data collection remove noise , best data activity.

the main intent of data collection construct user activity detection application using neural network library (neuroph android) link.

just fun wrote pedometer few weeks ago, , have been able detect 3 activities mentioned. i'd make following observations:

  1. in addition sensor.type_accelerometer, android has sensor.type_gravity , sensor.type_linear_acceleration. if log values of three, notice values of type_accelerometer equal sum of values of type_gravity , type_linear_acceleration. onsensorchanged(…) method first gives type_accelerometer, followed type_gravity , type_linear_acceleration results of internal methodology of splitting accelerometer readings gravity , acceleration that's not due gravity. given you're interested in acceleration due activities, rather acceleration due gravity, may find type_linear_acceleration better need.
  2. whatever sensors use, x, y, z you're measuring depend on orientation of device. however, detecting activities mention, result can't depend on e.g. whether user holding device in portrait or landscape position, or whether device flat or vertical, individual values of x, y , z won't use. instead you'll have @ length of vector, i.e. sqrt(xx+yy+zz) independent of device orientation.
  3. you need smooth data if you're feeding sensitive noise. instead, i'd data data, , you'll best results if use mechanisms aren't sensitive noise , hence don't need data smoothed. definition, smoothing discarding data. want design algorithm takes noisy data in @ 1 end , outputs current activity @ other end, don't prejudge whether it's necessary include smoothing part of algorithm
  4. here graph of sqrt(xx+yy+zz) sensor.type_ accelerometer recorded when building pedometer. graphs shows readings measured when walked 100 steps. green line sqrt(xx+yy+z*z), blue line exponentially weighted moving average of green line gives me average level of green line, , red line shows algorithm counting steps. able count steps looking maximum , minimums , when green line crosses blue line. didn't use smoothing or fast fourier transforms. in experience, sort of thing simplest algorithms work best, because although complex ones might work in situations it's harder predict how they'll behave in situations. , robustness vital characteristic of algorithm :-).

enter image description here


Comments