# Creates a mules_client mules_client = mules.MulesClient(mules_ip, muse_port) params = mules_client.getparams() # Get the device parameters #%% Set the experiment parameters eeg_buffer_secs = 15 # Size of the EEG data buffer used for plotting the # signal (in seconds) win_test_secs = 1 # Length of the window used for computing the features # (in seconds) overlap_secs = 0.5 # Overlap between two consecutive windows (in seconds) shift_secs = win_test_secs - overlap_secs index_channel = 1 # Index of the channnel to be used (with the Muse, we # can choose from 0 to 3) # Get name of features names_of_features = BCIw.feature_names(params["names of channels"]) #%% Initialize the buffers for storing raw EEG and features # Initialize raw EEG data buffer (for plotting) eeg_buffer = np.zeros((params["sampling frequency"] * eeg_buffer_secs, len(params["names of channels"]))) # Compute the number of windows in "eeg_buffer_secs" (used for plotting) n_win_test = int(np.floor((eeg_buffer_secs - win_test_secs) / float(shift_secs) + 1)) # Initialize the feature data buffer (for plotting) feat_buffer = np.zeros((n_win_test, len(names_of_features))) # Initialize the plots plotter_eeg = BCIw.dataPlotter( params["sampling frequency"] * eeg_buffer_secs, params["names of channels"], params["sampling frequency"]
#%% Set the experiment parameters eeg_buffer_secs = 15 # Size of the EEG data buffer used for plotting the # signal (in seconds) win_test_secs = 1 # Length of the window used for computing the features # (in seconds) overlap_secs = 0.5 # Overlap between two consecutive windows (in seconds) shift_secs = win_test_secs - overlap_secs index_channel = 1 # Index of the channnel to be used (with the Muse, we # can choose from 0 to 3) # This line changes params to work with only one electrode params['names of channels'] = ['CH1','STATUS'] # Get name of features names_of_features = BCIw.feature_names(params['names of channels']) #%% Initialize the buffers for storing raw EEG and features # Initialize raw EEG data buffer (for plotting) eeg_buffer = np.zeros((params['sampling frequency']*eeg_buffer_secs, len(params['names of channels']))) # Compute the number of windows in "eeg_buffer_secs" (used for plotting) n_win_test = int(np.floor((eeg_buffer_secs - win_test_secs) / float(shift_secs) + 1)) # Initialize the feature data buffer (for plotting) feat_buffer = np.zeros((n_win_test, len(names_of_features))) # Initialize the plots
# Creates a mules_client mules_client = mules.MulesClient(mules_ip, muse_port) params = mules_client.getparams() # Get the device parameters #%% Set the experiment parameters eeg_buffer_secs = 15 # Size of the EEG data buffer used for plotting the # signal (in seconds) win_test_secs = 1 # Length of the window used for computing the features # (in seconds) overlap_secs = 0.5 # Overlap between two consecutive windows (in seconds) shift_secs = win_test_secs - overlap_secs index_channel = 1 # Index of the channnel to be used (with the Muse, we # can choose from 0 to 3) # Get name of features names_of_features = BCIw.feature_names(params['names of channels']) #%% Initialize the buffers for storing raw EEG and features # Initialize raw EEG data buffer (for plotting) eeg_buffer = np.zeros((params['sampling frequency']*eeg_buffer_secs, len(params['names of channels']))) # Compute the number of windows in "eeg_buffer_secs" (used for plotting) n_win_test = int(np.floor((eeg_buffer_secs - win_test_secs) / float(shift_secs) + 1)) # Initialize the feature data buffer (for plotting) feat_buffer = np.zeros((n_win_test, len(names_of_features))) # Initialize the plots plotter_eeg = BCIw.dataPlotter(params['sampling frequency']*eeg_buffer_secs,