Skip to main content
. 2012 Sep 21;12(9):12844–12869. doi: 10.3390/s120912844

Algorithm 1 Human Activity Classification Algorithm.

while true do
  Acquire accelerometer readings, Ax Ay Az are three components along three axes;
  Calculate acceleration A=Ax2+Ay2+Az2;;
  Calculate σ, covariance of A in a 3 s sliding window;
  if Aδ1 and σδ2 then
   {δ1 and δ2 are two thresholds.}
   return Walking;
  else
   if |Az| ≤ ε then
    {ε is a small number closed to zero.}
    return Lying;
   else
    return Standing;
   end if
   end if
end while