This documentation is for development version 0.18.dev0.


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

Compute whitening matrix.

noise_cov : Covariance

The noise covariance.

info : dict

The measurement info.

picks : str | list | slice | None

Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g., ['meg', 'eeg']) will pick channels of those types, channel name strings (e.g., ['MEG0111', 'MEG2623'] will pick the given channels. Can also be the string values “all” to pick all channels, or “data” to pick data channels. None (default) will pick good data channels(excluding reference MEG channels).

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).

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.