Commit ed80943f authored by Julian Kosciessa's avatar Julian Kosciessa
Browse files

removed downsampling for high-pass filter in both scripts, thus scale 1...

removed downsampling for high-pass filter in both scripts, thus scale 1 entropy is assessed for each frequency, with exclusive variations in the spectral content of the signal
parent 189fd2f2
...@@ -316,19 +316,25 @@ for s = 1:numel(timescales) % loop through timescales ...@@ -316,19 +316,25 @@ for s = 1:numel(timescales) % loop through timescales
nchan = size(data_sel.trial{1},1); nchan = size(data_sel.trial{1},1);
end end
% do point skipping % do point skipping for scales > 1, non-HP option
cg_data = {}; cg_data = {};
switch coarsegrainmethod switch coarsegrainmethod
case 'filtskip' case 'filtskip'
nloops = sc; if strcmp(filtmethod, 'hp')
nloops = 1; % keep original sampling rate
stepSize = 1;
else
nloops = sc;
stepSize = sc;
end
cg_data = cell(nloops,1); % make cell: cg_data{istart}{trials}(chan-by-time) cg_data = cell(nloops,1); % make cell: cg_data{istart}{trials}(chan-by-time)
resamp_x = data_sel.trial; resamp_x = data_sel.trial;
for is = 1:nloops % loop over starting points here! for is = 1:nloops % loop over starting points here!
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 ); % downsample data
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
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 cg_data{1} = data_sel.trial; %only keep trial data
nloops = 1; % no loop across starting points 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
......
...@@ -246,18 +246,25 @@ for s = 1:numel(timescales) % loop through timescales ...@@ -246,18 +246,25 @@ for s = 1:numel(timescales) % loop through timescales
break % subsequent time points will also not work break % subsequent time points will also not work
end end
% do point skipping for scales > 1, non-HP option
cg_data = {}; cg_data = {};
switch coarsegrainmethod switch coarsegrainmethod
case 'filtskip' 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) cg_data = cell(nloops,1); % make cell: cg_data{istart}{trials}(chan-by-time)
for is = 1:nloops % loop over starting points here! for is = 1:nloops % loop over starting points here!
resamp_x = data_sel.trial; 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 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
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 cg_data{1} = data_sel.trial; %only keep trial data
nloops = 1; % no loop across starting points 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
......
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