eegprep.clean_channels_nolocs#

eegprep.clean_channels_nolocs(EEG, min_corr=0.45, ignored_quantile=0.1, window_len=2.0, max_broken_time=0.5, linenoise_aware=True)#

Remove channels with abnormal data from a continuous data set.

This is an automated artifact rejection function which ensures that the data contains no channels that record only noise for extended periods of time. If channels with control signals are contained in the data these are usually also removed. The criterion is based on correlation: if a channel is decorrelated from all others (pairwise correlation < a given threshold), excluding a given fraction of most correlated channels – and if this holds on for a sufficiently long fraction of the data set – then the channel is removed.

Parameters:
  • EEG (Dict[str, Any]) – Continuous data set, assumed to be appropriately high-passed (e.g. >0.5Hz or with a 0.5Hz - 2.0Hz transition band).

  • min_corr (float) – Minimum correlation between a channel and any other channel (in a short period of time) below which the channel is considered abnormal for that time period. Reasonable range: 0.4 (very lax) to 0.6 (quite aggressive).

  • ignored_quantile (float) – Fraction of channels that need to have at least the given MinCorrelation value w.r.t. the channel under consideration. This allows to deal with channels or small groups of channels that measure the same noise source. Reasonable range: 0.05 (rather lax) to 0.2 (very tolerant re disconnected/shorted channels).

  • window_len (float) – Length of the windows (in seconds) for which correlation is computed.

  • max_broken_time (float) – Maximum time (either in seconds or as fraction of the recording) during which a retained channel may be broken. Reasonable range: 0.1 (very aggressive) to 0.6 (very lax).

  • linenoise_aware (bool) – Whether the operation should be performed in a line-noise aware manner. If enabled, the correlation measure will not be affected by the presence or absence of line noise (using a temporary notch filter).

Return type:

Tuple[Dict[str, Any], ndarray]

Returns#

EEG : data set with bad channels removed removed_channels : boolean array indicating which channels were removed