Back to the main page.

Bug 1125 - remove DC offset prior to time-domain filtering in ft_preproc_*filter

Status CLOSED FIXED
Reported 2011-11-08 16:00:00 +0100
Modified 2011-12-15 09:24:32 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P1 normal
Assigned to: Johanna
URL:
Tags:
Depends on:
Blocks:
See also:

Johanna - 2011-11-08 16:00:04 +0100

It should be more numerically correct to first remove mean of window that you're filtering. (that's how it's done in nut_filter2). Do this within each ft_preproc_*filter fcn. Then add mean back for output of each subfunction. Then preproc will do user-specified detrend/demean/polyremoval.


Jan-Mathijs Schoffelen - 2011-11-09 08:45:44 +0100

Created attachment 181 demonstrate the issue of DC-offset/linear trend with bpfilter


Johanna - 2011-11-14 14:57:52 +0100

Polyremoval, detrend, and demean are now above filtering. All other order has been preserved.


Johanna - 2011-11-18 14:29:44 +0100

ammended to previous comment: demean/detrend/polyremove added back *after* filtering to occur as well as *before* filtering. some residual mean/trend may exist after filtering.


Johanna - 2011-11-30 12:51:46 +0100

made change to only ft_preproc_bandstopfilter and ft_preproc_lowpassfilter, as doesn't make sense to add back the mean for the other two (highpass and bandpass). svn commit 4890.


Johanna - 2011-11-30 12:52:22 +0100

see previous comment