Commit 3126e1e9 authored by Julian Kosciessa's avatar Julian Kosciessa
Browse files

apply old updates to PME function

parent c77f6ae6
......@@ -246,18 +246,25 @@ for s = 1:numel(timescales) % loop through timescales
break % subsequent time points will also not work
end
% do point skipping for scales > 1, non-HP option
cg_data = {};
switch coarsegrainmethod
case 'filtskip'
nloops = sc;
if strcmp(filtmethod, 'hp')
nloops = 1; % keep original sampling rate for hp option
stepSize = 1;
else
nloops = sc;
stepSize = sc;
end
cg_data = cell(nloops,1); % make cell: cg_data{istart}{trials}(chan-by-time)
for is = 1:nloops % loop over starting points here!
resamp_x = data_sel.trial;
cg_data{is} = cellfun(@(resamp_x) resamp_x(:, is:(sc-1+1):end), resamp_x, 'UniformOutput', false ); % add padding% Filter
cg_data{is} = cellfun(@(resamp_x) resamp_x(:, is:(stepSize-1+1):end), resamp_x, 'UniformOutput', false ); % add padding% Filter
end
clear resamp_x;
case 'pointavg' % original point averaging coarse graining, no loop over starting points
if sc == 1 % no coarse graining for native sampling rate
if sc == 1 || strcmp(filtmethod, 'hp') % no coarse graining for native sampling rate or high-pass entropy
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
......
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