Newer
Older
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
%% Rename Empirical to Applied
if ~artoa.data.hasMember(artoaWorkspace, 'editOffsets', 'offsets', 'EmpiricalOffset')
artoaWorkspace.editOffsets.offsets = addvars( ...
artoaWorkspace.editOffsets.offsets, ...
getEmpiricOffset4234(artoaWorkspace.editOffsets.offsets), ...
'NewVariableNames', {'EmpiricOffset'}, ...
'After', 5 ...
);
end
if ~artoa.data.hasMember(artoaWorkspace, 'editOffsets', 'offsets', 'EmpiricalDrift')
artoaWorkspace.editOffsets.offsets = addvars( ...
artoaWorkspace.editOffsets.offsets, ...
getEmpiricDrift4234(artoaWorkspace.editOffsets.offsets), ...
'NewVariableNames', {'EmpiricDrift'}, ...
'After', 6 ...
);
end
%% Helper functions
function [empiricalOffset] = getEmpiricOffset4234(pOffsetTable)
soundsources = artoa.controller.getSoundsourcesWithAppliedToa();
fnames = fieldnames(soundsources);
empiricalOffset = NaN(size(pOffsetTable, 1), 1);
% get all empirical offsets of soundsources
for i = 1:length(fnames)
if length(soundsources.(fnames{i}).empiric_offset) < 4
continue;
end
end
end
function [empiricalDrift] = getEmpiricDrift4234(pOffsetTable)
soundsources = artoa.controller.getSoundsourcesWithAppliedToa();
fnames = fieldnames(soundsources);
empiricalDrift = NaN(size(pOffsetTable, 1), 1);
% get all empirical offsets of soundsources
for i = 1:length(fnames)
empiricalDrift(i+1) = artoa.data.getMember(soundsources, {fnames{i}, 'empiric_drift'}, NaN);
end
end