Filtering

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Thu Jun 1 12:35:43 CEST 2006


Hi Vladimir

On 30 May 2006, at 16:14, Vladimir Litvak wrote:
> As I understand, when I do filtering in preprocessing the filter is
> applied before the data is cut to epochs.

Not completely: a segment of data is read from file that contains the
trial (trl) plus the optional padding. That segment is filtered and
then the padding is thrown away. Eventual filter atrifacts at the
boundaries of the data segment that was read are in the padding and
thus would not affect the data of interest itself. If you apply
padding, the effect is the same as if you would have filtered the
complete data continuously.

> I now want to do some analysis where I want to filter after the
> epochs are cut out (because there are TMS deltas there and I don't
> want them to affect everything around them). Is there a simple way
> to filter epoched data in FT (other than by my own code)?

You can specify cfg.padding=0 in preprocessing and ensure that the
TMS pulse is not inside the trial definition. You can do
preprocessing without any options and then use timelockanalysis (with
keeptrials) on it. Timelockanalysis supports almost all options that
preprocessing has, i.e. all filtering and baselinecorection options,
but of course cannot do the padding. Those additional options are not
documented in timelockanalysis, but look in the code and you will
see  them. Doing it in timelockanalysis has the advantage that it is
easier to play around with filter settings (i.e. it is faster not
having to read the data every time). Also interesting to know perhaps
is that you can also apply timelockanalysis and its filtering to an
average, i.e. timelockanalysis will accept a timelock-structure as
input. So you can average in the first call to timelockanalysis, and
then throw that average into timelockanalysis a second time to see
the effect of the filter. In the latter case only the average is
filtered, i.e. it is very fast.

best
Robert



More information about the fieldtrip mailing list