NeilwBailey / RELAX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error using designfilt>parseAndDesignFilter (line 411)

cmmrandau opened this issue · comments

Hello again Neil W Bailey

I've encountered another quite puzzling error. It occurs only after having processed one dataset, i.e., restarting MATLAB - but not EEGLAB or cleanvars - makes every file complete successfully. Needless to say it's been driving me crazy for a few hours so now I'm posting here to see if you can figure out what's going on. MATLAB 2021b, EEGLAB and all plugins inlcuding RELAX latest versions. Datasets in bdf-format originally and imported with EEGLAB double precision. Again: restarting MATLAB makes it work, one dataset at a time, so something "drags on" between datasets in the folder to be processed.

Removing frequency artifacts using ZapLine with adaptations for automatic component selection and chunked data.
 
 
 
---------------- PLEASE CITE ------------------
 
Klug, M., & Kloosterman, N. A. (2022).Zapline-plus: A Zapline extension for automatic and adaptiveremoval of frequency-specific noise artifacts in M/EEG.
Human Brain Mapping,1–16. https://doi.org/10.1002/hbm.25832
 
-------------------- AND ---------------------
 
de Cheveigne, A. (2020) ZapLine: a simple and effective method to remove power line artifacts.
NeuroImage, 1, 1-13. https://doi.org/10.1016/j.neuroimage.2019.116356
 
------------------ THANKS! -------------------
 
 
 
Warning: Data set is short. Adjusted window size for whole data set spectrum calculation to be 1/8 of the length! 
Computing initial spectrum...
Searching for first noise frequency between 17 and 99Hz...
Removing noise at 48.0003Hz... 
Using adaptive chunk length!
Error using designfilt>parseAndDesignFilter (line 411)
SWITCH expression must be a scalar or a character vector.

Error in designfilt (line 189)
  [err,requestedResponse,parseParams,h] = parseAndDesignFilter(inputParamValueNames, varargin{:});

Error in bandpass>designFilter (line 253)
opts.FilterObject = designfilt(params{:});

Error in bandpass (line 121)
    opts = designFilter(opts);

Error in clean_data_with_zapline_plus (line 356)
        data_narrowfilt = bandpass(data,[noisefreq-detectionWinsize/2 noisefreq+detectionWinsize/2],srate);

Error in clean_data_with_zapline_plus_eeglab_wrapper (line 25)
    [EEG.data, EEG.etc.zapline.config, EEG.etc.zapline.analyticsResults, plothandles] = clean_data_with_zapline_plus(EEG.data, EEG.srate, zaplineConfig);
 

I'll let you know if I somehow solve this. It occurred after I upgraded my OS, so it's not with certainty related to RELAX.

BW
Martin

Hello again
Can confirm that this error is due to either the newest fieldtrip or PREP, since downgrading these removes the error. I will explore a bit more when I have the time, but for now I'm happy that it works again.
BW
Martin

Hi Martin

Sorry about the seriously slow reply. I haven't had time for any bug fixes to the non-default RELAX options recently.

Did you end up determining the cause of the error? If not, I'll explore the issue more when I have some time.

Kind regards,

Neil

Hi Martin

I've just updated my versions of fieldtrip and zapline plus to the latest versions, which seems to have solved the problem for me. Hopefully it solves it for you also?

Kind regards,

Neil