[FieldTrip] Filtering the raw data

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Fri Aug 26 11:16:16 CEST 2022


Dear Arno,

I assume that your statement pertains to a situation where the filtering is done on a (very) long stretch of data before epoching, or where the filtering is done on epoched - potentially padded by an arbitrary amount of data to avoid edge artifacts of the filter - data?

The ft_preprocessing function either works on in-memory data (when called as ft_preprocessing(cfg, data)) or reads in some specified data on-the-fly, and applies some processing to it (when called as ft_preprocessing(cfg)). In the former case, the data are processed per epoch, so a filter indeed may produce edge artifacts if the data and the filter characteristics don’t like each other. In the former case, if the input cfg.trl already defines epochs, the processing is also per epoch, but edge effects of filters may be alleviated by liberally using the cfg.padding option. This is documented here: https://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work/

If you want to apply a (highpass)filter to the full data record, then ft_preprocessing needs to be instructed to read in the whole data as a single epoch (by an appropriate defintion of cfg.trl), and then, ft_redefinetrial can be used to chop up this single long epoch into the experimental epochs of interest.

Does this align with your assessment?

Best wishes,
JM






On 25 Aug 2022, at 01:17, Arnaud Delorme via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Seems to me that, when dealing with event-related data, Fieldtrip filters data epochs by default and that filtering the raw data requires resaving it as raw data and reimporting it.
Is that a fair assessment?

Arno
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!-sdyRFjiDPzYrt7No3ILRwT8f1-U1fTcLFsmtzrlilaJdC4HkP2-er4dv3vY_UuSp5wb0b1kb-A73tvtd_-LkHSjXcVwL-dF3mAVCQ$

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220826/463c0ef5/attachment.htm>


More information about the fieldtrip mailing list