<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Dear Arno,
<div class=""><br class="">
</div>
<div class="">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? </div>
<div class=""><br class="">
</div>
<div class="">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: <a href="https://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work/" class="">https://www.fieldtriptoolbox.org/faq/how_does_the_filter_padding_in_preprocessing_work/</a></div>
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class="">Does this align with your assessment?</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">JM</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 25 Aug 2022, at 01:17, Arnaud Delorme via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">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.<br class="">
Is that a fair assessment?<br class="">
<br class="">
Arno<br class="">
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!-sdyRFjiDPzYrt7No3ILRwT8f1-U1fTcLFsmtzrlilaJdC4HkP2-er4dv3vY_UuSp5wb0b1kb-A73tvtd_-LkHSjXcVwL-dF3mAVCQ$  <br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>