-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalyzeData.m
More file actions
32 lines (31 loc) · 1.28 KB
/
analyzeData.m
File metadata and controls
32 lines (31 loc) · 1.28 KB
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
function analyzeData(analysisType, makeFrequencyPlot)
if nargin < 2
makeFrequencyPlot = false;
end
titles = {};
if strcmp('metronome_70bpm_phone_midline', analysisType) == 1
accelData = parsePowerSenseData('./Data/70bpm-phonemidline.csv');
bounds = [400, 1000];
titles{1} = 'Lateral to body';
titles{2} = 'Aligned with gravity';
titles{3} = 'Aligned with direction of motion';
end
if strcmp('metronome_90bpm_phone_midline', analysisType) == 1
accelData = parsePowerSenseData('./Data/90bpm-phonemidline.csv');
bounds = [500, 1600];
titles{1} = 'Lateral to body';
titles{2} = 'Aligned with gravity';
titles{3} = 'Aligned with direction of motion';
end
if strcmp('skateboard', analysisType) == 1
accelData = parsePowerSenseData('./Data/skateboard.csv');
bounds = [1, size(accelData,1)];
titles{1} = 'Lateral to board';
titles{2} = 'Aligned with direction of motion';
titles{3} = 'Aligned with gravity';
end
% only use the indices within the boundaries
accelData = accelData(bounds(1):bounds(2), :);
% make timestamps uniformly spaced, and optionally change sample rate
makeAccelerometerPlots(accelData, titles, makeFrequencyPlot);
end