[FieldTrip] Applying mtmconvol to iEEG data

Gabriel Obregon-Henao obregon at uw.edu
Wed Sep 4 23:30:40 CEST 2019


Hello everyone,

I’ve been trying to compute a time-frequency decomposition on my iEEG
recordings via the multitaper method, and I’m seeing a really strange
output that looks similar to the issue described in the Wiki on the effects
that a DC offset can have on the output of the ‘mtmconvol’ method. I’m not
sure what's causing this effect since not only do I highpass filter the
entire recording, but I also detrend/demean my epochs. Below I’m copying
the code that I’ve been using, as well as as an image of one of my channels
showing average power across trials relative to baseline (in dB). I’d
really appreciate if someone could help me figure out what’s going on.

My current hypothesis is that this might be caused by trials with
interictal discharges that slipped past my cleaning pipeline, combined with
a short window length and the way in which Fieldtrip implements the
multitaper method.

Thanks,

--Gabriel


*Code:*

%%  load data and apply highpass filter
m = matfile([subjid '_' rec_day '_preproc.mat']);

cfg = [];
cfg.hpfilter = 'yes';
cfg.hpfilttype = 'firws';
cfg.hpfiltdir = 'onepass-zerophase';
cfg.hpfreq = .5;

data = ft_preprocessing(cfg, m.dataF);

%%  epoch data aligned to stimulus onset
cfg = [];
cfg.trl = m.res_trl;

epochs = ft_redefinetrial(cfg, data);

%%  remove bad trials and choose latency
cfg = [];
cfg.trials = setdiff(1:numel(epochs.trial), m.badtrials);
cfg.latency = [-2 4];

epochs = ft_selectdata(cfg, epochs);

%%  compute TFRs
cfg = [];
cfg.method = 'mtmconvol';
cfg.taper = 'dpss';
cfg.output = 'pow';
cfg.channel = 'all';
cfg.trials = 'all';
cfg.keeptrials = 'yes';

t_ftimwin = .25;        % 250 ms

cfg.toi = -1:.025:3;    % 90% overlap

df = 1/t_ftimwin;       % 4 Hz

cfg.foi = 30:df:200;

cfg.t_ftimwin = t_ftimwin * ones(size(cfg.foi));

cfg.tapsmofrq = 2 * ones(size(cfg.foi)) / t_ftimwin;    % 8 Hz

TFR = ft_freqanalysis(cfg, epochs);

%%  compute average power across trials
cfg = [];
cfg.avgoverrpt = 'yes';

TFR = ft_selectdata(cfg, TFR);

%%  perform baseline normalization
cfg = [];
cfg.baseline = [-.5 -.2];
cfg.baselinetype = 'db';

TFR = ft_freqbaseline(cfg, TFR);

*Output:*

[image: LPS03_MeanRelativePower.png]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190904/4fab58c2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LPS03_MeanRelativePower.png
Type: image/png
Size: 371416 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190904/4fab58c2/attachment-0001.png>


More information about the fieldtrip mailing list