mne.cov.compute_whitener

mne.cov.compute_whitener(noise_cov, info, picks=None, rank=None, scalings=None, return_rank=False, verbose=None)[source]

Compute whitening matrix.

Parameters:
noise_cov : Covariance

The noise covariance.

info : dict

The measurement info.

picks : array-like of int | None

The channels indices to include. If None the MEG and EEG channels in info, except bad channels, are used.

rank : None | int | dict

Specified rank of the noise covariance matrix. If None, the rank is detected automatically. If int, the rank is specified for the MEG channels. A dictionary with entries ‘eeg’ and/or ‘meg’ can be used to specify the rank for each modality.

scalings : dict | None

The rescaling method to be applied. See documentation of prepare_noise_cov for details.

return_rank : bool

If True, return the rank used to compute the whitener.

New in version 0.15.

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more).

Returns:
W : 2d array

The whitening matrix.

ch_names : list

The channel names.

rank : int

Rank reduction of the whitener. Returned only if return_rank is True.