def setUpClass(cls): x = np.linspace(0, 1000, 1000, endpoint=False) y = 5 * np.sin(np.pi * x / 300) data = np.tile(y[:, None], (1, len(CHANNEL_10_20))) data += np.random.normal(size=data.shape) axes = [x, [i[0] for i in CHANNEL_10_20]] cls.cnt = Data(data=data, axes=axes, names=['time', 'channel'], units=['ms', '#']) cls.cnt.fs = 1000 classes = [0, 1] * 5 data = np.array([data]*10) data[::2] *= 0.5 axes = [classes, x, [i[0] for i in CHANNEL_10_20]] cls.epo = Data(data=data, axes=axes, names=['class', 'time', 'channel'], units=['#', 'ms', '#']) cls.epo.fs = 1000 cls.epo.class_names = ['class 1', 'class 2'] plot.beautify()
def setUpClass(cls): x = np.linspace(0, 1000, 1000, endpoint=False) y = 5 * np.sin(2 * np.pi * x) data = np.tile(y[:, None], (1, len(CHANNEL_10_20))) data += np.random.normal(size=data.shape) axes = [x, [i[0] for i in CHANNEL_10_20]] cls.cnt = Data(data=data, axes=axes, names=['time', 'channel'], units=['ms', '#']) cls.cnt.fs = 1000 classes = [0, 1] * 5 data = np.array([data] * 10) data[::2] *= 0.5 axes = [classes, x, [i[0] for i in CHANNEL_10_20]] cls.epo = Data(data=data, axes=axes, names=['class', 'time', 'channel'], units=['#', 'ms', '#']) cls.epo.fs = 1000 cls.epo.class_names = ['class 1', 'class 2'] plot.beautify()
# coding: utf-8 # In[1]: from __future__ import division import numpy as np import scipy as sp from matplotlib import pyplot as plt from matplotlib import ticker import matplotlib as mpl from wyrm import plot plot.beautify() from wyrm.types import Data from wyrm import processing as proc from wyrm.io import load_bcicomp3_ds2 # In[2]: TRAIN_A = r'C:\Users\ORI\Documents\IDC-non-sync\Thesis\PythonApplication1\ipytho_notebook\follow_wyrm_tutorial\data\BCI_Comp_III_Wads_2004\Subject_A_Train.mat' TRAIN_B = r'C:\Users\ORI\Documents\IDC-non-sync\Thesis\PythonApplication1\ipytho_notebook\follow_wyrm_tutorial\data\BCI_Comp_III_Wads_2004\Subject_B_Train.mat' TEST_A = r'C:\Users\ORI\Documents\IDC-non-sync\Thesis\PythonApplication1\ipytho_notebook\follow_wyrm_tutorial\data\BCI_Comp_III_Wads_2004/Subject_A_Test.mat' TEST_B = r'C:\Users\ORI\Documents\IDC-non-sync\Thesis\PythonApplication1\ipytho_notebook\follow_wyrm_tutorial\data\BCI_Comp_III_Wads_2004/Subject_B_Test.mat' TRUE_LABELS_A = 'WQXPLZCOMRKO97YFZDEZ1DPI9NNVGRQDJCUVRMEUOOOJD2UFYPOO6J7LDGYEGOA5VHNEHBTXOO1TDOILUEE5BFAEEXAW_K4R3MRU' TRUE_LABELS_B = 'MERMIROOMUHJPXJOHUVLEORZP3GLOO7AUFDKEFTWEOOALZOP9ROCGZET1Y19EWX65QUYU7NAK_4YCJDVDNGQXODBEV2B5EFDIDNR'
import numpy as np import scipy as sp from matplotlib import pyplot as plt import matplotlib as mpl from wyrm import processing as proc from wyrm.types import Data from wyrm import plot from wyrm.io import load_bcicomp3_ds1 plot.beautify() b, a = proc.signal.butter(5, [13 / 500], btype='low')