[FieldTrip] Filtering the raw data
Schoffelen, J.M. (Jan Mathijs)
janmathijs.schoffelen at donders.ru.nl
Fri Aug 26 11:16:16 CEST 2022
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?
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?
fieldtrip mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fieldtrip