How to detect walking with Android accelerometer

前端 未结 5 1390
悲&欢浪女
悲&欢浪女 2020-12-13 04:53

I\'m writing an application and my aim is to detect when a user is walking. I\'m using a Kalman filter like this:

float kFilteringFactor=0.6f;

        gravi         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-13 05:29

    My first intuition would be to run an FFT analysis on the sensor history, and see what frequencies have high magnitudes when walking.

    It's essentially seeing what walking "sounds like", treating the accelerometer sensor inputs like a microphone and seeing the frequencies that are loud when walking (in other words, at what frequency is the biggest acceleration happening).

    I'd guess you'd be looking for a high magnitude at some low frequency (like footstep rate) or maybe something else. It would be interesting to see the data.

    My guess is you run the FFT and look for the magnitude at some frequency to be greater than some threshold, or the difference between magnitudes of two of the frequencies is more than some amount. Again, the actual data would determine how you attempt to detect it.

提交回复
热议问题