forked from macvicab/MITT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCleanSeries.m
37 lines (31 loc) · 946 Bytes
/
CleanSeries.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
function CleanSeries(GUIControl)
% Control file for cleaning time series
% Called from MITT
% Calls CleanSpike, CleanFilter, and AutoPlotTimeSeries
% get list of all files in MITT directory
ncleantot = length(GUIControl.MITTdir);
for nclean = 1:ncleantot
inname = [GUIControl.odir,filesep,GUIControl.MITTdir(nclean).name];
load(inname,'Config','Data');
% despike
if GUIControl.Despike
if ~Config.Despiked || GUIControl.SpikeReset
Data = CleanSpike(Config,Data,GUIControl);
Config.Despiked = 1;
end
end
% filter using butterworth
if GUIControl.FiltrBW
if ~Config.Filtered || GUIControl.SpikeReset
Data = CleanFilter(Config,Data,GUIControl);
Config.Filtered = 1;
end
end
% display
if GUIControl.plotTimeSeries
PlotTimeSeries(Config,Data,[])
end
% save data
save(inname,'Config','Data');
end
end