[FieldTrip] Padding before start of recorded data

Ward, E.G.E. (Emma) e.ward at psych.ru.nl
Thu Sep 10 19:06:35 CEST 2020


Dear mailing list,


I am currently preparing infant EEG data for a wavelet analysis, specifically to look at gamma and theta, and have a question about trial length and padding.


I have 0.5s baseline followed by 2s trials in which the stimulus is present onscreen. We were planning to define trials that are extra long, that is, with one second of true data before the baseline period and one second of true data after the stimulus offset, in order to avoid edge artifacts in filtering and wavelet analysis. (This in addition to more mirror padding for the wavelet transform step itself.) But, I have one or two participants for whom the beginning of the first stimulus is too close to the beginning of the recording, with no space for the extra second in front of the baseline period.


Because this is infant data and we don't have so many trials, I would like to avoid losing the first trial in these cases, if possible. I am therefore thinking about a solution in which, only for infants whose first trial was too close to the beginning of the recording, I do some kind of additional padding at the beginning of the first trial.


My questions are:


1) is this a legitimate and useful approach? The extra time being cut is really just data padding anyway, but for these one or two infants the padding method would then be different (perhaps taking the first sample of the first trial and filling back to the desired length, or mirroring the pre-stimulus data we do have, or something else if someone has a suggestion).


2) if this approach is indeed legitimate and useful, how could I best go about it? My ft_definetrial is currently happily defining trials with begin samples before 0, it's only when I get to my ft_preprocessing step that I get an error for the participant with not enough data, but I don't yet see an easy way to incorporate this adjustment into the preprocessing, whereas in my trialfun I'm already looping over trials to make the trl matrix, and can include a "if trialBeginSample < 0..." type statement.


It is of course also entirely possible that defining extra-long trials is for some reason less advisable than padding using cfg.pad and cfg.padding during my other steps, so if that's the case I'm also happy to hear it.


Thanks for any suggestions or thoughts you might have!


Best wishes,


Emma Ward, MSc
Postdoctoral researcher, FU Berlin
e-mail: e.ward at donders.ru.nl (will soon change)
website: https://sites.google.com/view/emma-k-ward
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200910/6e168071/attachment.htm>


More information about the fieldtrip mailing list