sccn / clean_rawdata

Cleaning Raw EEG data
GNU General Public License v3.0
42 stars 17 forks source link

Windows to remove in clean_windows #16

Closed Nadia631 closed 3 years ago

Nadia631 commented 3 years ago

Dear all,

I find problems to understand how to determine which windows to remove, in function clean_windows and in lines code: 119-122

I don't understand exactly why we are looking only at the channel (end-max_bad_channels) to check the condition ( > max(zthresholds)) and only at channel (1+max_bad_channels) to check the condition (< min(zthresholds)) ?

And how in that sense, the variable 'max_bad_channels' refers to the maximum number or fraction of bad channels that a retained window may still contain (more than this and it is removed)?

Should we, for each window, check the conditions for all the channels? And keep windows where a certain number of channels (max_bad_channels) check the above conditions?

thank you in advance

arnodelorme commented 3 years ago

This is because when z score are sorted, the last max_bad_channels might be bad (high z score) or the lowest max_bad_channels might be bad as well (low z score).