-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnalyzeIMU.m
101 lines (98 loc) · 2.97 KB
/
AnalyzeIMU.m
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
% Script to plot Accelerometer Data
% from RombergLab for iOS APP - https://apps.apple.com/us/app/romberglab/id1440287860?l=en
% Originally developed by Jorge Rey-Martinez 2018
% Authors: Ariadna Valldeperes, Xabier Altuna, Jorge Rey Martinez
% (C)2020
% Load OCTAVE required Packages
if isOctave
pkg load signal
pkg load statistics
end
[T,X,Y,Z,gX,gY,gZ,Talt,alt,Tmag,mX,mY,mZ,C] = read();
if size(T) < 1
display('No data was loaded !')
return
end
%Modos Ni�os
index1 = find(C == 1);
index2 = find(C == 2);
index3 = find(C == 3);
%Modo Libre
index4 = find(C == 4);
%Modos Posturografia
index11 = find(C == 11);
index12 = find(C == 12);
index13 = find(C == 13);
index14 = find(C == 14);
if ~isempty(index1)
%Change axis to match with device orientation Buton & ligt right, buton
%top to light, both looking to observer eyes
T1 = T(index1);
X1 = Y(index1);
Y1 = -Z(index1);
Z1 = -X(index1);
[pX,pY,pZ] = getPosition(T1,X1,Y1,Z1,'Condition C1');
end
if ~isempty(index2)
%Change axis to match with device orientation Buton & ligt right, buton
%top to light, both looking to observer eyes
T1 = T(index2);
X1 = Y(index2);
Y1 = -Z(index2);
Z1 = -X(index2);
[pX,pY,pZ] = getPosition(T1,X1,Y1,Z1,'Condition C2');
end
if ~isempty(index3)
%Change axis to match with device orientation Buton & ligt right, buton
%top to light, both looking to observer eyes
T1 = T(index3);
X1 = Y(index3);
Y1 = -Z(index3);
Z1 = -X(index3);
[pX,pY,pZ] = getPosition(T1,X1,Y1,Z1,'Condition C3');
end
if ~isempty(index4)
%Change axis to match with device orientation Buton & ligt right, buton
%top to light, both looking to observer eyes
T1 = T(index4);
X1 = Y(index4);
Y1 = -Z(index4);
Z1 = -X(index4);
[pX,pY,pZ] = getPosition(T1,X1,Y1,Z1,'Condition F');
end
if ~isempty(index11)
%Change axis to match with device orientation Buton & ligt right, buton
%top to light, both looking to observer eyes
T1 = T(index11);
X1 = Y(index11);
Y1 = -Z(index11);
Z1 = -X(index11);
[pX,pY,pZ] = getPosition(T1,X1,Y1,Z1,'Condition P1');
end
if ~isempty(index12)
%Change axis to match with device orientation Buton & ligt right, buton
%top to light, both looking to observer eyes
T1 = T(index12);
X1 = Y(index12);
Y1 = -Z(index12);
Z1 = -X(index12);
[pX,pY,pZ] = getPosition(T1,X1,Y1,Z1,'Condition P2');
end
if ~isempty(index13)
%Change axis to match with device orientation Buton & ligt right, buton
%top to light, both looking to observer eyes
T1 = T(index13);
X1 = Y(index13);
Y1 = -Z(index13);
Z1 = -X(index13);
[pX,pY,pZ] = getPosition(T1,X1,Y1,Z1,'Condition P3');
end
if ~isempty(index14)
%Change axis to match with device orientation Buton & ligt right, buton
%top to light, both looking to observer eyes
T1 = T(index14);
X1 = Y(index14);
Y1 = -Z(index14);
Z1 = -X(index14);
[pX,pY,pZ] = getPosition(T1,X1,Y1,Z1,'Condition P4');
end