-
Notifications
You must be signed in to change notification settings - Fork 0
/
cookbook.txt
107 lines (88 loc) · 5.99 KB
/
cookbook.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
-- this part came from the original data set, the beginning --
The features selected for this database come from the accelerometer and gyroscope 3-axial raw signals tAcc-XYZ and tGyro-XYZ. These time domain signals (prefix 't' to denote time) were captured at a constant rate of 50 Hz. Then they were filtered using a median filter and a 3rd order low pass Butterworth filter with a corner frequency of 20 Hz to remove noise. Similarly, the acceleration signal was then separated into body and gravity acceleration signals (tBodyAcc-XYZ and tGravityAcc-XYZ) using another low pass Butterworth filter with a corner frequency of 0.3 Hz.
Subsequently, the body linear acceleration and angular velocity were derived in time to obtain Jerk signals (tBodyAccJerk-XYZ and tBodyGyroJerk-XYZ). Also the magnitude of these three-dimensional signals were calculated using the Euclidean norm (tBodyAccMag, tGravityAccMag, tBodyAccJerkMag, tBodyGyroMag, tBodyGyroJerkMag).
Finally a Fast Fourier Transform (FFT) was applied to some of these signals producing fBodyAcc-XYZ, fBodyAccJerk-XYZ, fBodyGyro-XYZ, fBodyAccJerkMag, fBodyGyroMag, fBodyGyroJerkMag. (Note the 'f' to indicate frequency domain signals).
These signals were used to estimate variables of the feature vector for each pattern:
'-XYZ' is used to denote 3-axial signals in the X, Y and Z directions.
tBodyAcc-XYZ
tGravityAcc-XYZ
tBodyAccJerk-XYZ
tBodyGyro-XYZ
tBodyGyroJerk-XYZ
tBodyAccMag
tGravityAccMag
tBodyAccJerkMag
tBodyGyroMag
tBodyGyroJerkMag
fBodyAcc-XYZ
fBodyAccJerk-XYZ
fBodyGyro-XYZ
fBodyAccMag
fBodyAccJerkMag
fBodyGyroMag
fBodyGyroJerkMag
The set of variables that were estimated from these signals are:
mean(): Mean value
std(): Standard deviation
mad(): Median absolute deviation
max(): Largest value in array
min(): Smallest value in array
sma(): Signal magnitude area
energy(): Energy measure. Sum of the squares divided by the number of values.
iqr(): Interquartile range
entropy(): Signal entropy
arCoeff(): Autorregresion coefficients with Burg order equal to 4
correlation(): correlation coefficient between two signals
maxInds(): index of the frequency component with largest magnitude
meanFreq(): Weighted average of the frequency components to obtain a mean frequency
skewness(): skewness of the frequency domain signal
kurtosis(): kurtosis of the frequency domain signal
bandsEnergy(): Energy of a frequency interval within the 64 bins of the FFT of each window.
angle(): Angle between to vectors.
Additional vectors obtained by averaging the signals in a signal window sample. These are used on the angle() variable:
gravityMean
tBodyAccMean
tBodyAccJerkMean
tBodyGyroMean
tBodyGyroJerkMean
-- this part came from the original data set, the end --
From the above features, if the feature names contain the words "mean" or "std", they are extracted and took a mean based on subject and activity, and formed the data frame HARDataAggr
HARDataAggr, group by SubjectID and ActivityID, and take mean of the rest of the fields
All Columns
[1] "Group.SubjectID" "Group.ActivityID" "SubjectID"
[4] "ActivityID" "tBodyAcc.mean...X" "tBodyAcc.mean...Y"
[7] "tBodyAcc.mean...Z" "tBodyAcc.std...X" "tBodyAcc.std...Y"
[10] "tBodyAcc.std...Z" "tGravityAcc.mean...X" "tGravityAcc.mean...Y"
[13] "tGravityAcc.mean...Z" "tGravityAcc.std...X" "tGravityAcc.std...Y"
[16] "tGravityAcc.std...Z" "tBodyAccJerk.mean...X" "tBodyAccJerk.mean...Y"
[19] "tBodyAccJerk.mean...Z" "tBodyAccJerk.std...X" "tBodyAccJerk.std...Y"
[22] "tBodyAccJerk.std...Z" "tBodyGyro.mean...X" "tBodyGyro.mean...Y"
[25] "tBodyGyro.mean...Z" "tBodyGyro.std...X" "tBodyGyro.std...Y"
[28] "tBodyGyro.std...Z" "tBodyGyroJerk.mean...X" "tBodyGyroJerk.mean...Y"
[31] "tBodyGyroJerk.mean...Z" "tBodyGyroJerk.std...X" "tBodyGyroJerk.std...Y"
[34] "tBodyGyroJerk.std...Z" "tBodyAccMag.mean.." "tBodyAccMag.std.."
[37] "tGravityAccMag.mean.." "tGravityAccMag.std.." "tBodyAccJerkMag.mean.."
[40] "tBodyAccJerkMag.std.." "tBodyGyroMag.mean.." "tBodyGyroMag.std.."
[43] "tBodyGyroJerkMag.mean.." "tBodyGyroJerkMag.std.." "fBodyAcc.mean...X"
[46] "fBodyAcc.mean...Y" "fBodyAcc.mean...Z" "fBodyAcc.std...X"
[49] "fBodyAcc.std...Y" "fBodyAcc.std...Z" "fBodyAcc.meanFreq...X"
[52] "fBodyAcc.meanFreq...Y" "fBodyAcc.meanFreq...Z" "fBodyAccJerk.mean...X"
[55] "fBodyAccJerk.mean...Y" "fBodyAccJerk.mean...Z" "fBodyAccJerk.std...X"
[58] "fBodyAccJerk.std...Y" "fBodyAccJerk.std...Z" "fBodyAccJerk.meanFreq...X"
[61] "fBodyAccJerk.meanFreq...Y" "fBodyAccJerk.meanFreq...Z" "fBodyGyro.mean...X"
[64] "fBodyGyro.mean...Y" "fBodyGyro.mean...Z" "fBodyGyro.std...X"
[67] "fBodyGyro.std...Y" "fBodyGyro.std...Z" "fBodyGyro.meanFreq...X"
[70] "fBodyGyro.meanFreq...Y" "fBodyGyro.meanFreq...Z" "fBodyAccMag.mean.."
[73] "fBodyAccMag.std.." "fBodyAccMag.meanFreq.." "fBodyBodyAccJerkMag.mean.."
[76] "fBodyBodyAccJerkMag.std.." "fBodyBodyAccJerkMag.meanFreq.." "fBodyBodyGyroMag.mean.."
[79] "fBodyBodyGyroMag.std.." "fBodyBodyGyroMag.meanFreq.." "fBodyBodyGyroJerkMag.mean.."
[82] "fBodyBodyGyroJerkMag.std.." "fBodyBodyGyroJerkMag.meanFreq.."
ActivityID:
1 WALKING
2 WALKING_UPSTAIRS
3 WALKING_DOWNSTAIRS
4 SITTING
5 STANDING
6 LAYING
SubjectID:
1-30 30 volunteers