Signal Processing

Signal processing basics and EEG.

Topographical Plots

Preamble

import mne

Dataset

Download sample data from Mike Cohen.

def load_data(tmin, tmax):
    epochs = mne.io.read_epochs_eeglab('sampleEEGdata.mat', verbose=False).crop(tmin, tmax)
    return epochs

All Trials

raw = load_data(-1, 1)
values = (raw.get_data().mean(axis=0).squeeze())
evoked = mne.EvokedArray(values, raw.info, tmin=-1)

Plot Topographical Map at 0ms

evoked.plot_topomap(times=[0], time_unit='ms',cmap='Spectral_r');
Notebook PNG image

Plot Topographical Map at 0ms, 500ms, and 1000ms

evoked.plot_topomap(times=[0, .5, 1], time_unit='ms',cmap='Spectral_r');

Plot First 5 Topographical Maps

evoked.plot_topomap(times=evoked.times[0:6], time_unit='ms',cmap='Spectral_r');
Notebook PNG image

Plot Sensor Position

evoked.plot_sensors();
Notebook PNG image

evoked.plot_sensors(kind='3d', ch_groups='position');

Single Trial

raw = load_data(-1, 1)
values = (raw[0].get_data().squeeze())
evoked = mne.EvokedArray(values, raw.info, tmin=-1)

Plot Topographical Map at 0ms

evoked.plot_topomap(times=[0], time_unit='ms',cmap='Spectral_r');
Notebook PNG image

Plot Topographical Map at 0ms, 500ms, and 1000ms

evoked.plot_topomap(times=[0, .5, 1], time_unit='ms',cmap='Spectral_r');
Notebook PNG image

Plot First 5 Topographical Maps

evoked.plot_topomap(times=evoked.times[0:6], time_unit='ms',cmap='Spectral_r');
Notebook PNG image

Comments

From the collection

Signal Processing

Signal processing basics and EEG.