As part of ongoing tutoring and demonstrating duties at DCU, project work in education was undertaken for the Laboratory Tutoring module. The work in this project outlines a punch counter that leverages mobile phone sensors and the MATLAB mobile app, acting as a simple cost-effective way to introduce students to gathering Biomechanical data with sensors. The difficulty can be increased and scaled to analyse gait cycle for a final year undergraduate project and potential publication.
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Biomechanical data gathering with mobile phone sensors and analysis as a suggested module improvement
1. Experiment/Lab/Project Suggestion
by Muhammad Alli
GS607-Laboratoy Tutoring
Preface: After teaching on PS256 Environmental Physics Laboratories and PS154 Introduction to
Computing; I think that a project based approach for a computing topic treading on physics and
human movement would be quite interesting for students particularly the ones more interested
seeing how we can use technology to quantify or interpret human movement in a hands on manner.
Contents
Requirements: ....................................................................................................................................... 2
Setup: .................................................................................................................................................... 2
Suggested Lab/Project: .......................................................................................................................... 2
MATLAB Script ....................................................................................................................................... 3
Suggested Lab/Project (continued): ...................................................................................................... 4
Comments and Recommendations:....................................................................................................... 5
References ..............................................................................................................................................5
Figure 1: Acceleration vs Time, 12 Peaks Representing 12 Punches ...................................................... 4
Figure 2: Number of Punches Recorded is Equal to the Number of Punches Thrown ........................... 4
2. Requirements:
• An Android phone running android 4.4 or later connected to the internet.
• The MATLAB Android App(free).
• A laptop or PC connected to the internet.
• A MATLAB Professional or Academic Licence for R2014a or later
Setup:
Instructions to setup MATLAB on PC to utilise Android sensors:
http://uk.mathworks.com/help/supportpkg/mobilesensor/
Instructions to connect MATLAB PC and MATLAB Mobile to one another:
http://uk.mathworks.com/help/matlabmobile_android/connect-to-your-computer.html
MATLAB example for a Step Counter:
http://uk.mathworks.com/help/supportpkg/mobilesensor/examples/counting-steps-by-
capturingacceleration-data-from-your-android-device.html
Suggested Lab/Project: A Punch Counter for Boxing
MATLAB mobile can leverage a number of sensors and gather data with them.
The sensors can gather acceleration data, angular velocity data, magnetic field data, orientation data
and position data.
For this lab we would use the accelerometer. A student would grip the phone and Run the Code below
in MATLAB on the PC and throw punches when they are prompted to “Start Punching”. The sensor will
gather data for 8 seconds and pass it to the PC. All calculations and programming required is in the
script.
The reason why we use a punch is because the motion results in a sharp acceleration.
3. MATLAB Script
clear all
close all m
= mobiledev
m.AccelerationSensorEnabled = 1;
m.Logging = 1; disp('start
punching') pause(8);
m.Logging = 0; [a, t] =
accellog(m); figure(1) plot(t,
a); legend('X', 'Y', 'Z');
xlabel('Relative time (s)');
ylabel('Acceleration (m/s^2)');
%fs=0.067999839782715;
%% We use the magnitude of X,Y and Z to make the calculation robust
regardless of the planar orientation to the human to the phone sensor
x = a(:,1); y = a(:,2); z = a(:,3);
mag = sqrt(sum(x.^2 + y.^2 + z.^2, 2));
figure(2) plot(t, mag); xlabel('Time
(s)'); ylabel('Acceleration (m/s^2)');
%% We subtract the mean to remove background features and remove constants
eg. acceleration due to gravity magNoG = mag - mean(mag);
magNoG=abs(magNoG); figure(3) plot(t, magNoG); xlabel('Time (s)');
ylabel('Acceleration (m/s^2)');
%%
minPeakHeight = 1*std(magNoG);
[pks, locs] = findpeaks(magNoG, 'MINPEAKHEIGHT', minPeakHeight);
Number_of_Punches = numel(pks)
%% hold
on;
plot(t(locs), pks, 'r', 'Marker', 'v', 'LineStyle',
'none'); title('Counting Punches'); xlabel('Time (s)');
ylabel('Acceleration Magnitude, No Gravity (m/s^2)'); hold
off;
m.AccelerationSensorEnabled = 0;
clear m;
Suggested Lab/Project (continued):
For my own tests I threw out 12 punches and the images below show this prototype working
successfully.
4. Counting Punches
Time (s)
Figure 1: Acceleration vs Time, 12 Peaks Representing 12 Punches
Figure 2: Number of Punches Recorded is Equal to the Number of Punches Thrown
0 1 2 3 4 5 6 7 8
0
1
2
3
4
5
6
7
8
9
5. As the physical quantity we are measuring here is acceleration we can pose questions about
orientation to students, how perspective in what we establish as “forwards” means we have a positive
acceleration and going the opposite way means “backwards” and a negative acceleration.
Comments and Recommendations:
For a first year student I would suggest to proceed as above and allow student to do some supporting
report work and read up to compliment things.
For 2nd
year students and above, providing the minimal programming basics on acquiring the data from
the sensors then getting students to work on the data analysis would could prove to be a big learning
experience and confidence boost if paired well with the correct amount of supervision and guidance.
Matlab basics are substantially more intuitive and faster to pick up than c or c++, 2 days inapplication
should suffice.[1]
For final year Students an FYP investigation into the Gait cycle using these sensors shows promise as
an opportunity for student growth and a potential publication. Sensor placement and methodologies
are outlined quite extensively. [2-5]
References
[1] Alli MB. Computational Physics A Guide For Beginners Looking To Speed Up THier Computation
[Internet]. Muhammad Bilal Alli; 2016. 1-18 p. Available from:
https://www.academia.edu/27509533/Computational_Physics_A_Guide_For_Beginners_Loo
king_To_Speed_Up_Their_Computation
[2] Boyle M, Klausner A, Starobinski D, Trachtenberg A. Gait-based User Classification Using Phone
Sensors. :395–6.
[3] Kwapisz JR, Weiss GM, Moore SA. Cell Phone-Based Biometric Identification.
[4]. Lu H. Unobtrusive Gait Verification for Mobile Phones. 2014;91–8.
[5]. Thang HM, Viet VQ, Thuc ND, Choi D, Korea S, Chi H, et al. Gait Identification Using
Accelerometer on Mobile Phone.