|
|
| Algorithm 1 Human Activity Classification Algorithm. |
|
|
| while true do |
| Acquire accelerometer readings, Ax Ay Az are three components along three axes; |
| Calculate acceleration ; |
| 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 |