.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_ica_eeg.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_ica_eeg.py: ======================================================= Blind source separation using preconditioned ICA on EEG ======================================================= The example runs the Picard-O algorithm proposed in: Pierre Ablin, Jean-François Cardoso, Alexandre Gramfort "Faster ICA under orthogonal constraint" ICASSP, 2018 https://arxiv.org/abs/1711.10873 .. GENERATED FROM PYTHON SOURCE LINES 14-29 .. code-block:: default # Author: Pierre Ablin # Alexandre Gramfort # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt import mne from mne.datasets import sample from scipy.stats import kurtosis from picard import picard print(__doc__) .. GENERATED FROM PYTHON SOURCE LINES 30-31 Generate sample EEG data .. GENERATED FROM PYTHON SOURCE LINES 31-44 .. code-block:: default data_path = sample.data_path() raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif' raw = mne.io.read_raw_fif(raw_fname, preload=True) raw.filter(1, 40, n_jobs=1) # 1Hz high pass is often helpful for fitting ICA picks = mne.pick_types(raw.info, meg=False, eeg=True, eog=False, stim=False, exclude='bads') random_state = 0 data = raw[picks, :][0] data = data[:, ::2] # decimate a bit .. rst-class:: sphx-glr-script-out .. code-block:: none Using default location ~/mne_data for sample... Creating ~/mne_data Downloading file 'MNE-sample-data-processed.tar.gz' from 'https://osf.io/86qa2/download?version=6' to '/home/circleci/mne_data'. 0%| | 0.00/1.65G [00:00` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_ica_eeg.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_