-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFiltSweepsOnBlink.m
22 lines (17 loc) · 974 Bytes
/
FiltSweepsOnBlink.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function ExcludedMask = FiltSweepsOnBlink(Blinks, SearchBaseMask, TrigsForAlignment, FilterConfig)
ExcludedMask = false(length(TrigsForAlignment), 1);
for i = 1:length(TrigsForAlignment)
if ~SearchBaseMask(i)
continue
end
if sum(Blinks.startTs>=(TrigsForAlignment(i)+(FilterConfig.FromSec*1000*1000)) & Blinks.startTs<=(TrigsForAlignment(i)+(FilterConfig.ToSec*1000*1000))) > 0 || ...
sum(Blinks.endTs>=(TrigsForAlignment(i)+(FilterConfig.FromSec*1000*1000)) & Blinks.endTs<=(TrigsForAlignment(i)+(FilterConfig.ToSec*1000*1000))) > 0 || ...
sum(Blinks.startTs<(TrigsForAlignment(i)+(FilterConfig.FromSec*1000*1000)) & Blinks.endTs>(TrigsForAlignment(i)+(FilterConfig.ToSec*1000*1000))) > 0
% NOTE: MICROSEC
ExcludedMask(i) = true;
end
if ExcludedMask(i)
log_d(['Excluded trial nr. ' num2str(i)]);
end
end
end