Plot an estimate of data SNRΒΆ

This estimates the SNR as a function of time for a set of data.


Script output:

Preparing the inverse operator for use...
    Scaled noise and source covariance from nave = 1 to nave = 47
    Created the regularized inverter
    Created an SSP operator (subspace dimension = 3)
    Created the whitener using a full noise covariance matrix (3 small eigenvalues omitted)
Picked 305 channels from the data
Effective nchan = 305 - 3 = 302
# Author: Eric Larson <>
# License: BSD (3-clause)

from os import path as op

from mne.datasets.sample import data_path
from mne.minimum_norm import read_inverse_operator
from mne import read_evokeds
from mne.viz import plot_snr_estimate


data_dir = op.join(data_path(), 'MEG', 'sample')
fname_inv = op.join(data_dir, 'sample_audvis-meg-oct-6-meg-inv.fif')
fname_evoked = op.join(data_dir, 'sample_audvis-ave.fif')

inv = read_inverse_operator(fname_inv)
evoked = read_evokeds(fname_evoked, baseline=(None, 0))[0]

plot_snr_estimate(evoked, inv)

Total running time of the script: (0 minutes 0.642 seconds)

Download Python source code: