[FieldTrip] error in filter_with_correction

Teresa Madsen braingirl at gmail.com
Wed Mar 1 20:22:48 CET 2017


Did you also try searching the mailing list archives?  The same error has
come up a few times.
<https://www.google.com/search?q=%22Calculated+filter+coefficients+have+poles+on+or+outside+the+unit+circle%22+site:mailman.science.ru.nl/pipermail/fieldtrip/&filter=0>

What is your trial duration and sampling frequency?  You'll need several
seconds to get an accurate idea of what's going on in such low frequencies.

Have you tried just detrending and applying a 2 Hz low-pass filter?  It
seems like that might have essentially the same effect.

Hope one of those helps,
Teresa


On Fri, Feb 24, 2017 at 8:29 PM, Wong-Barnum, Mona <mona at sdsc.edu> wrote:

> Hello fellow FieldTrip'er:
>
> Can someone help me understand and hopefully fix the following runtime
> error message I am seeing (I searched a bit on the website documentation
> but didn’t find anything):
>
> Error using filter_with_correction (line 51)
> Calculated filter coefficients have poles on or outside the unit circle and
> will not be stable. Try a higher cutoff frequency or a different
> type/order of
> filter.
>
> Error in filter_with_correction (line 51)
>   error('Calculated filter coefficients have poles on or outside the unit
>   circle and will not be stable. Try a higher cutoff frequency or a
> different
>   type/order of filter.');
>
> Error in ft_preproc_bandpassfilter (line 286)
>   filt = filter_with_correction(B,A,dat,dir,usefftfilt);
>
> Error in preproc (line 324)
>   if strcmp(cfg.bpfilter, 'yes'),     dat = ft_preproc_bandpassfilter(dat,
>   fsample, cfg.bpfreq, cfg.bpfiltord, cfg.bpfilttype, cfg.bpfiltdir,
>   cfg.bpinstabilityfix, cfg.bpfiltdf, cfg.bpfiltwintype, cfg.bpfiltdev,
>   cfg.plotfiltresp, cfg.usefftfilt); end
>
> Error in ft_preprocessing (line 592)
>       [cutdat{i}, label, time{i}, cfg] = preproc(dat, hdr.label(rawindx),
> tim,
>       cfg, begpadding, endpadding);
>
> Error in test (line 25)
> data = ft_preprocessing ( cfg );
>
> Error in run (line 96)
> evalin('caller', [script ';']);
>
> Here is my script:
>
> addpath /path/to/my/fieldtrip
> ft_defaults
>
> % 1. MEG
> disp ( 'Reading 1.fif...' )
> cfg = [];
> cfg.dataset = '1.fif';
> data = ft_preprocessing ( cfg );
>
> disp ( 'Getting MEG channel 1...' )
> meg_channel = ft_channelselection ( 'MEG0111', data.label );
> cfg = [];
> cfg.channel = meg_channel;
> meg = ft_selectdata ( cfg, data );
> disp ( 'Saving meg...' )
> save meg.mat meg -v7.3;
> clearvars cfg meg;
>
> % 2. Low delta MEG
> disp ( 'Low delta MEG...' )
> cfg = [];
> cfg.bpfilter = 'yes';
> cfg.bpfreq = [0.1 2];
> cfg.dataset = '1.fif';
> data = ft_preprocessing ( cfg );
>
> cfg = [];
> cfg.channel = meg_channel;
> cfg.frequency = [0.1 2];
> meg = ft_selectdata ( cfg, data );
> disp ( 'Saving low delta meg...' )
> save low_delta_meg.mat meg -v7.3;
> clearvars cfg meg;
>
> Line #25 is the last “data = ft_preprocessing ( cfg );” line.
>
> If I do cfg.bpfreq = [2 4] then there is no error but I really like to get
> this low [0.1 2] range…any tips?
>
> Mona
>
> *********************************************
>     Mona Wong
>     Web & Mobile Application Developer
>     San Diego Supercomputer Center
>
>     Believing we are in control is an
>     illusion that brings suffering.
> *********************************************
>
>
>
>
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>



-- 
Teresa E. Madsen, PhD
Research Technical Specialist:  *in vivo *electrophysiology & data analysis
Division of Behavioral Neuroscience and Psychiatric Disorders
Yerkes National Primate Research Center
Emory University
Rainnie Lab, NSB 5233
954 Gatewood Rd. NE
Atlanta, GA 30329
(770) 296-9119
braingirl at gmail.com
https://www.linkedin.com/in/temadsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170301/f08f1c44/attachment-0001.html>


More information about the fieldtrip mailing list