Commit a602d86c authored by Niels Kloosterman's avatar Niels Kloosterman
Browse files

fixed point averaging coarse graining + minor changes

parent 189fd2f2
...@@ -127,6 +127,10 @@ filtmethod = ft_getopt(cfg, 'filtmethod', 'lp'); ...@@ -127,6 +127,10 @@ filtmethod = ft_getopt(cfg, 'filtmethod', 'lp');
mem_available = ft_getopt(cfg, 'mem_available', 8e9); % 8 GB mem_available = ft_getopt(cfg, 'mem_available', 8e9); % 8 GB
allowgpu = ft_getopt(cfg, 'allowgpu', 1); % 8 GB allowgpu = ft_getopt(cfg, 'allowgpu', 1); % 8 GB
if strcmp(cfg.coarsegrainmethod, 'pointavg')
filtmethod = 'no'; % no filtering for point averaging
end
gpuavailable = gpuDeviceCount; gpuavailable = gpuDeviceCount;
if allowgpu && gpuavailable if allowgpu && gpuavailable
fprintf('GPU device found. Running things there\n') fprintf('GPU device found. Running things there\n')
...@@ -328,11 +332,10 @@ for s = 1:numel(timescales) % loop through timescales ...@@ -328,11 +332,10 @@ for s = 1:numel(timescales) % loop through timescales
end end
clear resamp_x; clear resamp_x;
case 'pointavg' % original point averaging coarse graining, no loop over starting points case 'pointavg' % original point averaging coarse graining, no loop over starting points
nloops = 1; % no starting points loop for point avg
if sc == 1 % no coarse graining for native sampling rate if sc == 1 % no coarse graining for native sampling rate
cg_data{1} = data_sel.trial; %only keep trial data cg_data{1} = data_sel.trial; %only keep trial data
nloops = 1; % no loop across starting points
else % coarse-grain time series at this time scale else % coarse-grain time series at this time scale
nloops = 1; % no loop across starting points
nchan = size(data_sel.trial{1},1); nchan = size(data_sel.trial{1},1);
for itrial = 1:length(data_sel.trial) for itrial = 1:length(data_sel.trial)
num_cg_tpts = floor(length(data_sel.trial{itrial})/sc); % number of coarse-grained time points num_cg_tpts = floor(length(data_sel.trial{itrial})/sc); % number of coarse-grained time points
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment