[FieldTrip] Different cfg.poststim values in ft_preprocessing alters signal

Barnett, Benjy benjy.barnett.20 at ucl.ac.uk
Tue Feb 2 16:27:29 CET 2021


Hey. When I am preprocessing my MEG neuromag data, I’m noticing that the signal of my channels are altered depending on how long after the stimulus I include in the trial, even in the portion of the trial that is overlapping between the two cases. For instance, if I use cfg.poststim = 2.5 in one run and cfg.poststim = 0.6 in a second, the two signals are not identical up until 0.6 seconds. Please see my code and attached plots of a Grad sensor in these two cases up to 0.6 seconds.

 % define trials
        cfg = [];
        cfg.dataset = full_path;
        cfg.trialdef.prestim = 0.175;
        cfg.trialdef.poststim = 0.6; % compare with 2.5 seconds
        cfg.trialdef.eventvalue = [6 7 9];

        cfg.trialdef.eventtype = 'STI101';
        cfg = ft_definetrial(cfg);



        % preprocess



        cfg.demean = 'yes';
        cfg.baselinewindow = [-0.175 0.025];
        cfg.lpfilter = 'no';
        cfg.hpfilter = 'no';
        cfg.dftfilter = 'yes';
split_files{1} = ft_preprocessing(cfg); %preprocess


%%%%%%%%%%%Downsampling%%%%%%%%%
  cfg = [];
    cfg.resamplefs = 250;
    data = ft_resampledata(cfg, split_files{1});


%%Visualisation
cfg = [];
        cfg.channel = 'MEGGRAD';
        cfg.keeptrials = 'yes';
        data = ft_timelockanalysis(cfg,data);
Xlim([-0.2 0.6])
        plot(data.time,squeeze(mean(data.trial(:,39,:),1)))

As you can see from the plots attached, these signals are not identical when they should be (shouldn’t they?). The first plot is when I Use 2.5 seconds post stim and the second is using 0.6. I’ve altered the xlim to show only up to 600ms on both. Also, can anyone explain these huge spikes at the beginning of trials, that’s my next problem to solve.

Thanks
[cid:972C968D-ED1A-418C-B626-5137EF2C8759 at home][cid:FA70F34E-C8F5-4FD5-B3EC-60222BB0CD0E at home]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210202/6828e0c6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2_5_ch39_full.png
Type: image/png
Size: 21505 bytes
Desc: 2_5_ch39_full.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210202/6828e0c6/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 600_ch39_full.png
Type: image/png
Size: 19576 bytes
Desc: 600_ch39_full.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210202/6828e0c6/attachment-0001.png>


More information about the fieldtrip mailing list