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

updated help for recompute_r

parents fdc76be1 ca6574bb
......@@ -10,7 +10,8 @@ function mse = ft_entropyanalysis(cfg, data)
% | do not require data.trialinfo, get trialsize from .trial
% 190405 JQK | integrated changes from previous scripts: adpative padding
% length; no LPF at scale 1; changed indenting; removed
% outdated code
% outdated code; corrected BP setting: at scale 1 only use HP
% vs. LP
% FT_ENTROPYANALYSIS performs entropy and time-entropy analysis
% on time series data over multiple trials
......@@ -200,9 +201,10 @@ for s = 1:numel(timescales) % loop through timescales
padlength = ceil(size(data.trial{1},2)./2); % use half the length of trial 1 as padding (JQK)
x_pad = cellfun(@(a) ft_preproc_padding(a, 'mean', padlength), data.trial, 'UniformOutput', false ); % add padding
x_pad = cellfun(@transpose, x_pad, 'UniformOutput', false); % transpose for filtfilt: time x chan
resamp_x_pad = cellfun(@(x_pad) filtfilt(B,A,x_pad), x_pad, 'UniformOutput', false ); % low-pass filter data
if sc == 1
if sc == 1 % only HPF
resamp_x_pad = cellfun(@(x_pad) filtfilt(D,C,x_pad), x_pad, 'UniformOutput', false ); % high-pass filter data
else
resamp_x_pad = cellfun(@(x_pad) filtfilt(B,A,x_pad), x_pad, 'UniformOutput', false ); % low-pass filter data
resamp_x_pad = cellfun(@(resamp_x_pad) filtfilt(D,C,resamp_x_pad), resamp_x_pad, 'UniformOutput', false ); % high-pass filter data
end
resamp_x_pad = cellfun(@transpose, resamp_x_pad, 'UniformOutput', false); % transpose back : chan x time again
......
......@@ -10,6 +10,8 @@ function mse = ft_permentropyanalysis(cfg, data)
% | do not require data.trialinfo, get trialsize from .trial
% 190401 JQK | removed floor() for frequencies, at scale 1 use no LPF
% 190402 JQK | replaced sample entropy with permutation entropy
% 190405 JQK | corrected BP setting: at scale 1 only use HP
% vs. LP
% FT_PERMENTROPYANALYSIS performs temporally-resolved permutation entropy
% on time series data over multiple trials
......@@ -198,8 +200,10 @@ for s = 1:numel(timescales) % loop through timescales
x_pad = cellfun(@(a) ft_preproc_padding(a, 'mean', padlength), data.trial, 'UniformOutput', false ); % add padding
x_pad = cellfun(@transpose, x_pad, 'UniformOutput', false); % transpose for filtfilt: time x chan
resamp_x_pad = cellfun(@(x_pad) filtfilt(B,A,x_pad), x_pad, 'UniformOutput', false ); % low-pass filter data
if sc == 1
if sc == 1 % only HPF
resamp_x_pad = cellfun(@(x_pad) filtfilt(D,C,x_pad), x_pad, 'UniformOutput', false ); % high-pass filter data
else
resamp_x_pad = cellfun(@(x_pad) filtfilt(B,A,x_pad), x_pad, 'UniformOutput', false ); % low-pass filter data
resamp_x_pad = cellfun(@(resamp_x_pad) filtfilt(D,C,resamp_x_pad), resamp_x_pad, 'UniformOutput', false ); % high-pass filter data
end
resamp_x_pad = cellfun(@transpose, resamp_x_pad, 'UniformOutput', false); % transpose back : chan x time again
......
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