forked from TASBE/TASBEFlowAnalytics
-
Notifications
You must be signed in to change notification settings - Fork 1
/
time_filter.m
28 lines (25 loc) · 990 Bytes
/
time_filter.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
% Copyright (C) 2010-2017, Raytheon BBN Technologies and contributors listed
% in the AUTHORS file in TASBE analytics package distribution's top directory.
%
% This file is part of the TASBE analytics package, and is distributed
% under the terms of the GNU General Public License, with a linking
% exception, as described in the file LICENSE in the TASBE analytics
% package distribution's top directory.
function data = time_filter(fcshdr,rawfcs)
% Optional discarding of early (possibly contaminated) data
if(numel(rawfcs)==0), data = rawfcs; return; end
early_data_exclusion = 25; % Discard first 25/100 seconds of data as likely contaminated
found = false;
for j=1:numel(fcshdr.par)
if(strcmp('Time',fcshdr.par(j).name))
timechannel=rawfcs(:,j);
found=true; continue;
end
end
if(~found),
warning('Model:Time','Could not find Time channel');
data = rawfcs;
else
not_early = timechannel>early_data_exclusion;
data = rawfcs(not_early,:);
end