eeglab icon indicating copy to clipboard operation
eeglab copied to clipboard

several psd-related functions fail with low sampling rate EEG data

Open jiversen opened this issue 2 years ago • 1 comments

Description

A workshop participant had an extremely downsampled dataset with EEG.srate = 64.

inspect/label components by map and ICLabel both failed.

inspect/label components by map is hardwired to calculate PSD up to 50Hz ICLabel is hardwired to calculate PSD up to 100Hz

Thus, data with EEG.srate < 100 will fail for inspect/label components by map and data with EEG.srate < 200 will fail with ICLabel.

Solution

The easiest would be to add a check of EEG.srate and issue a warning that the data is not suitable.

jiversen avatar Sep 13 '22 23:09 jiversen

Good point. I will add a warning message and maybe remove the constraint.

arnodelorme avatar Sep 23 '22 05:09 arnodelorme

From https://github.com/sccn/ICLabel/issues/31

It appears that ICLabel creates PSD features with max frequency 100 Hz, and thus needs data with sampling rate >= 200 Hz.

However, ICLabel is written to assume that the only way it could fail is if the model mex has not been compiled properly, and in this case recompiles the mex file, which is the wrong solution. Then it tries again and fails again, incorrectly warning that complication was unsuccessful, while it was in fact successful.

In this case the model input is the problem, not the model. This is very confusing for the user.

Solution: add a check for EEG.state < 200, and error out informatively if so.

arnodelorme avatar Mar 24 '23 21:03 arnodelorme

OK, an error is being shown now.

arnodelorme avatar Feb 09 '24 23:02 arnodelorme