[Eeglablist] causal filtering pop_eegfiltnew

Andreas Widmann widmann at uni-leipzig.de
Fri Apr 26 09:38:12 PDT 2013


Dear Marta, Daniele and Makoto,

> As far as I understood, this leads to a phase shift because of the firfilt, and also, given that the impulse response of the filter is symetric, the filter is acausal (so that no causal analysis can be performed). 

A causal filter always has a phase shift. With symmetric FIR filters (as used in *both* the legacy and the new basic FIR filter) a causal filter has a phase shift of (filter length - 1) / 2 samples (the group delay). The phase shift can be corrected by either filtering the signal backwards (as in the legacy version) or by "shifting" the signal backwards by the group delay.

Symmetric FIR filters have a *linear* phase shift (constant group delay). That is, causally and non-causally filtered signals are basically identical, the causal version is just shifted by the group delay. Causal filtering with symmetric FIR filters, thus, makes sense only in very particular applications with electrophysiological data. That's why the option is not present in the new version at the moment. Please note: I do not recommend using the legacy version (see here why: http://www.frontiersin.org/Perception_Science/10.3389/fpsyg.2012.00233/full). If you really want to test causal symmetric FIR filtering you can use the new version and shift your event latencies backward by the group delay.

There will be soon a version of the new basic FIR filter allowing for causal filtering with *asymmetric* (minimum-phase converted) FIR filters. This allows for causal filtering with minimal phase shift at the cost of a non-linear phase response (similar to IIR filters; peaks can be shifted relative to each other).

Hope this helps. Best,
Andreas

Am 25.04.2013 um 18:33 schrieb Makoto Miyakoshi <mmiyakoshi at ucsd.edu>:

> Dear Daniele,
> 
> Thank you for your comment.
> 
> > if you don't want the phase shift, you should NOT check the "use causal filter" box.
> 
> You are right here. But Marta said
> 
> > if i want to get a causal filter i should be using the 'legacy' version of the pop_eegfilt that uses fir1 and firfirl to filter the data? 
> 
> So she wants to use the causal filter for some reason.
> 
> Marta, here is additional caution: 'use causal filter' does NOT keep ERP peak latencies unchanged (if that's what you want to test; here I'm just guessing).
> 
> Makoto
> 
> 
> 
> 2013/4/25 Daniele Marinazzo <daniele.marinazzo at gmail.com>
> actually from what I see in eegfilt.m, if causal option is on, it uses filter.m (phase shift introduced), otherwise is causal option is off it uses filtfilt.m (no phase shift).
> 
> so, if you don't want the phase shift, you should NOT check the "use causal filter" box.
> 
> do you confirm this, or is there a confusion with the nomenclature?
> 
> d.
> 
> 
> On Wed, Apr 24, 2013 at 10:10 PM, Makoto Miyakoshi <mmiyakoshi at ucsd.edu> wrote:
> Dear Marta,
> 
> > if i want to get a causal filter i should be using the 'legacy' version of the pop_eegfilt that uses fir1 and firfirl to filter the data? 
> 
> Right. Check the box 'use causal filter' when you run it.
> 
> Makoto 
> 
> 
> 2013/4/24 Marta Castellano <m at martacastellano.eu>
> Dear eeglablist,
> 
> I would need some help regarding the filtering of EEG data. 
> 
> I'm currently using the EEGlab 12.0.2.0b and filtering the data with pop_eegfiltnew, which creates a type 1 windowed synch filter and the filtering is implemented through firfirlt. As far as I understood, this leads to a phase shift because of the firfilt, and also, given that the impulse response of the filter is symetric, the filter is acausal (so that no causal analysis can be performed). 
> 
> Does that means that, if i want to get a causal filter i should be using the 'legacy' version of the pop_eegfilt that uses fir1 and firfirl to filter the data? 
> 
> Thanks a lot in advance for your help,
> 
> Marta
> 
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
> 
> 
> 
> -- 
> Makoto Miyakoshi
> Swartz Center for Computational Neuroscience
> Institute for Neural Computation, University of California San Diego
> 
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
> 
> 
> 
> 
> -- 
> Makoto Miyakoshi
> Swartz Center for Computational Neuroscience
> Institute for Neural Computation, University of California San Diego
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu





More information about the eeglablist mailing list