Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
ME220
In this Lab you will attempt to use inertial data to make a basic step counter. Inertial sensing-
based step counting is used commercially in standalone step counting products and has been
implemented into the health tracking features in many smartphone platforms. You will first make
a pedometer using a basic step counting algorithm, and then develop your own more complex
algorithm to handle more practical cases.
For this lab you may work in pairs and submit one lab report per group.
Part 1: A Basic Algorithm
1. Use phyphox to record three axis acceleration data with your phone in your pocket while
you walk around for about 30 seconds. Count the number of steps you took while
recording this data. Export the result and trim out any data at the start or end that does
not contain steps.
2. Plot the acceleration for each axis, and the value of the acceleration magnitude, over
time. (4 plots). What signatures of individual steps do you see?
3. Find the ASD of the acceleration magnitude. Comment on the step signal’s amplitude
and frequency.
4. Design a filter that allows you to separate the steps from other signals (such as the
acceleration of gravity). Justify your choice of filter type and cutoff frequency. Apply this
filter to the acceleration magnitude time series and plot the result.
5. Implement an algorithm that identifies a step by counting every time the filtered
acceleration crosses a certain threshold. Pick a threshold based on your plot in part 4.
6. How many steps does your algorithm identify? Make a plot showing the filtered
acceleration with each detected step annotated. Is this an over or under count compared
to the amount you counted manually? Comment on any misclassification.
7. After everything is working, record acceleration data while walking at least 5 more times,
and compare the estimated number of steps with the actual number of steps. If you’re
working with a partner, does the algorithm properly count steps for both of you?
Make sure to include the following items in your report:
• The plots in parts 1, 3, 4 and 6
• Your answers to all questions posed
• Any code used to do calculations and generate plots
Part 2: Beyond Thresholding
More complex methods for step counting are well known and have been implemented in
smartphones as part of the health monitoring suits common on personal devices. In this
application, the user exposes the sensor to many signals, from which steps have to be
extracted. Approaches to this problem can be seen in many references, some of which have
been included in with this lab and are excerpted below: These methods distinguish between
steps and other signals that result in a large acceleration like sitting down or moving holding the
sensor and moving it around. Human strides occur at a frequency around 1-2 Hz and induce
acceleration with a particular orientation with respect to gravity. By using these facts, it is
possible to better extract the signal of human footsteps.
1. Again, use phyphox to record three axis acceleration data with your phone in your
pocket while you walk around, but this time include sitting down, standing up, and
standing still during the collection period. Count the number of steps you took while
recording this data. Export the result, and this time do not trim the data.
2. Repeat this process but place the phone in a bag or backpack. Export the result.
3. Filter the acceleration magnitude from both data sets and plot it. Try to label the times
when you were walking, and when you were standing still. How can you distinguish a
step from other motions like sitting down, or moving around while sitting?
4. Run the algorithm developed in Part 1 on both new data sets. Annotate the steps it
identifies on your plot from question 3. How does it perform? Investigate the data around
any miscounting events and comment on why they occurred.
5. Based on the references above, develop a more complex algorithm to count steps that
performs better than the basic threshold method. Your algorithm should:
• Be able to distinguish between steps and other acceleration spike events like
sitting down, standing up, or jostling.
• Function with the phone positioned in any orientation, whether placed in a
pocket or in a bag.
• Detect steps of different size or gait
Lee (2015) Naqvi (2012)
Myo (2018)
Use a method inspired by the resources included with the lab, or by your own research
on the subject matter.
6. Compare your improved algorithm to the threshold algorithm on the basic data set taken
in Part 1. Does your improved method perform better in areas where the threshold
method miscounted?
7. Compare your improved algorithm to the threshold algorithm on the data sets taken in
Part 2. How does your algorithm perform? Comment on any over or undercounts? Does
your improved method work better when the phone is in a pocket, or in a bag?
Make sure to include the following items in your report:
• The plots and annotations from parts 3 and 4
• A detailed description of the algorithm you chose to implement. Include plots and
examples of individual components of the method.
• Your answers to all questions posed
• Any code used to do calculations and generate plots