-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBatch_02_aggregateResults.m
69 lines (56 loc) · 1.98 KB
/
Batch_02_aggregateResults.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Name: Batch_02_aggregateResults
% Date of Revision: 2016-08
% Programmer: Thomas Praetzlich
% Resources: https://dx.doi.org/10.6084/m9.figshare.3398545
%
% Description:
% Aggregate tempo EEG histograms into a cell data structure.
%
% Reference:
% [SPG16] Sebastian Stober; Thomas Prätzlich & Meinard Müller.
% Brain Beats: Tempo Extraction from EEG Data.
% International Society for Music Information Retrieval
% Conference (ISMIR), 2016
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Aggregate tempo EEG histograms into a single mat file...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% mat_pIDs = [ 01 04 06 07 09 11 12 13 14 ];
mat_pIDs = [ 09 11 12 13 14 ];
mat_sIDs = [ ...
01 02 03 04 ...
11 12 13 14 ...
21 22 23 24 ...
];
P = length(mat_pIDs);
S = length(mat_sIDs);
cell_temphist = cell( P, S);
dir_results = 'results/';
% data = 'raw';
data = 'sce';
tempo_win = 8;
file_suffix = ['twin' num2str(tempo_win)];
for p = 1:P
pID = mat_pIDs(p);
for s = 1:S
mat_tempohist = [];
sID = mat_sIDs(s);
file_pattern = sprintf(...
'%s_temphist_S%02d-P%02d-trial*-%sat',...
data,sID,pID,file_suffix);
% file_pattern = [ data '_temphist' '_P' num2str(pID,'%02d') '' file_suffix 'at'];
f=dir( [dir_results file_pattern] );
filenames = sort({ f.name });
for i = 1:length(filenames)
d=load( [dir_results filenames{i}] );
mat_tempohist = [ mat_tempohist; dean_tempogram' ];
end
cell_temphist{p,s} = mat_tempohist;
end
end
smooth_len = d.smooth_len;
tempo_win = d.tempo_win;
BPM = d.BPM;
save([dir_results data '-agg_temphist_' file_suffix],'cell_temphist','filenames','tempo_win','BPM');