[FieldTrip] Pre-stimulus baseline correction for response-locked ERPs

berry van den berg berryv.dberg at gmail.com
Wed Mar 11 10:45:07 CET 2015

Dear Marijke,

I dont think there is a fiedltrip function to do this but I could be wrong.
There are two alternatives that you can do. First, the easy solution, which
might not work for your paradigm: if I make a response locked ERP I usually
ensure that only trials with an RT between 200 and 1200ms (for a lot of
tasks this is a reasonable criteria - 200ms is unreasonable fast and 1200
is way too slow). You can then do a baseline correction of [-1.4-1.2],
which would ensure that there is no stimulus evoked activity in your
baseline period. The second solution requires looping over your trials and
subtracting a custom baseline for each trial, something like this:

% rts is a 1*ntrials matrix containing the rt for each trial in seconds
for iTrial = 1:length(rts)
% take the mean of the data for each channel prior to stimulus onset (based
on rts), replicate this matrix until the size of your original data and
subtract these mean values from your original epoch
     tmp =
repmat(mean(data.trial{iTrial}(:,data.time{iTrial}<-1*rts(iTrail) &
     data.trial{iTrial} = data.trial{iTrial} - tmp;

I hope that this helps!

Berry van den Berg

On 10 March 2015 at 13:13, Marijke Beulen <marijkebeulen at gmail.com> wrote:

>  Dear all,
> I was wondering if anyone knows how to define a stimulus-locked baseline period to correct a response-locked ERP using ft_timelockbaseline.
> So far, I've been plotting stimulus-locked ERPs and using ft_timelockbaseline with the 300ms before stimulus onset for baseline correction. I've tried other methods to do baseline correction manually, but so far, ft_timelockbaseline has given me the best results. However, now I also want to plot response-locked ERPs. To keep things comparable, I would like to use the same 300ms pre-stimulus interval for baseline correction, but my trials have different lengths. This means that after response-locking the data, the time stamp of that interval is different on every trial. Is there any way to e.g. define separate baseline windows for each trial or to give FieldTrip another (stimulus-locked) dataset to use as a baseline in ft_timelockbaseline?
> I've already searched through FieldTrip's documentation, but I haven't been able to find a solution. Any advice on how to do this would be much appreciated!
> Sincerely,
> Marijke Beulen
> --
> M.A. Beulen, MSc.
> PhD student at University of Groningen, dept. Artificial Intelligence
> Bernoulliborg, room 320
> Nijenborgh 9
> 9747 AG Groningen
> The Netherlands
> Phone: +31 50 363 6915m.a.beulen at rug.nl
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150311/1d70e19a/attachment-0002.html>

More information about the fieldtrip mailing list