[FieldTrip] What exactly does filterpadding do?

Brehm, J. (Julia) j.brehm at uu.nl
Mon May 2 16:31:43 CEST 2016

Dear Diego,

yes, thank you, I've seen that already. Unfortunately this does not really help me.

Apparently filtering is not even applied in my case (as the warning says). It seems that the NaNs are introduced in ft_fetch_data, shouldn't these be replaced by zeros where it's not filled by actual data when applying filterpadding? I assume it does that at some other point I couldn't find!?

Furthermore, in the interactive mode one can see that the z-values mimic the data in the first and last trial of the dataset. This leads to the detection of artifacts which are none and missing real artifacts (due to very large effects in those two trials). I have attached a screenshot to illustrate what I mean.

As far as I understand filterpadding uses zero-padding, meaning I can use it on segmented (not continuous) data, correct? So why does this have such a large effect on my whole data instead of simply getting rid of edge effects?

Sorry if I am missing something obvious.


From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Diego Lozano-Soldevilla [dlozanosoldevilla at gmail.com]
Sent: Monday, May 02, 2016 3:24 PM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] What exactly does filterpadding do?

Dear Julia,

>From the FAQ section:


I hope that helps,


On 2 May 2016 at 15:08, Brehm, J. (Julia) <j.brehm at uu.nl<redir.aspx?REF=bbm3PKzTSZZ7WAp2IZa3r2IscZbmOgYQdLrtX5WQsp0MbbmbkXLTCAFtYWlsdG86ai5icmVobUB1dS5ubA..>> wrote:
Dear list,

I am having problems applying filterpadding when using ft_artifact_zvalue.

Could someone please explain what exactly the effect of filterpadding is, and in which cases I can apply it and in which not?

I intended to use it to avoid edge effects in the artifact detection. However, I get the following warning (only when applying fltpadding, my data does not actually contain NaNs):

Warning: data contains NaNs, no filtering or preprocessing applied
> In ft_warning (line 181)
  In preproc (line 282)
  In ft_artifact_zvalue (line 292)

These are my settings:
cfg            = [];
cfg.trl        = temptrl; % all trials

cfg.artfctdef.zvalue.channel     = channel{ch};  % single channel
cfg.artfctdef.zvalue.cutoff      = 3;
cfg.artfctdef.zvalue.fltpadding  = 0.1;

cfg.artfctdef.zvalue.bpfilter   = 'yes';
cfg.artfctdef.zvalue.bpfilttype = 'but';
cfg.artfctdef.zvalue.bpfreq     = [1 3];
cfg.artfctdef.zvalue.bpfiltord  = 2;
cfg.artfctdef.zvalue.hilbert    = 'yes';



fieldtrip mailing list
fieldtrip at donders.ru.nl<redir.aspx?REF=G8XJ7tCtpbYE8RHR4kVgxIqdcT0l_J9AFDcMhGt9sDcMbbmbkXLTCAFtYWlsdG86ZmllbGR0cmlwQGRvbmRlcnMucnUubmw.>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160502/b63a7ec4/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fltpadding_demo.jpg
Type: image/jpeg
Size: 52120 bytes
Desc: fltpadding_demo.jpg
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160502/b63a7ec4/attachment-0002.jpg>

More information about the fieldtrip mailing list