zapline-plus icon indicating copy to clipboard operation
zapline-plus copied to clipboard

Error in designfilt

Open NinaOmejc opened this issue 1 year ago • 0 comments

Hi, thank you for a great toolbox. However, somehow I get an error using it.

I have EEGLAB v2023.1, zapline-plus version 1.2.1 (latest, installed through EEGLAB), signal processing toolbox installed. It is using functions in .\MATLAB\R2023a\toolbox\signal\signal\* I checked data have no nans and the sampling rate is 250 Hz. I call the function like this:

EEG = clean_data_with_zapline_plus_eeglab_wrapper(EEG, struct('noisefreqs', 'line', 'plotResults', 0, 'winSizeCompleteSpectrum', floor(EEG.pnts/8/EEG.srate)));

Any suggestions on what is wrong?

This is the output error:

Removing frequency artifacts using ZapLine with adaptations for automatic component selection and chunked data.
Computing initial spectrum...
"noisefreqs" parameter was set to 'line', found line noise candidate at 49.9725 Hz!
Searching for first noise frequency between 46.9725 and 52.9725Hz...
Removing noise at 49.9649Hz... 
Using adaptive chunk length!
Error using designfilt>parseAndDesignFilter
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);

Thank you!

NinaOmejc avatar Nov 23 '23 09:11 NinaOmejc