diff --git a/analyze_muse/analyze_muse_data.py b/analyze_muse/analyze_muse_data.py index 9a4a822..39b5a19 100755 --- a/analyze_muse/analyze_muse_data.py +++ b/analyze_muse/analyze_muse_data.py @@ -64,7 +64,8 @@ eeg_stats = [] CVS_fname = "" out_dirname = "" -Sampling_Rate = 250.0 +EEG_data_source = 'Mind Monitor' +Sampling_Rate = 256.0 Filter_Lowcut = 0.1 Filter_Highcut = 100.0 Filter_Order = 3 @@ -827,7 +828,25 @@ def read_eeg_data(fname, date_time_now): columns=['Beta_TP9', 'Beta_AF7', 'Beta_AF8', 'Beta_TP10']) gamma_df = pd.DataFrame(muse_EEG_data, columns=['Gamma_TP9', 'Gamma_AF7', 'Gamma_AF8', 'Gamma_TP10']) - + + +# Scale Mind Monitor brainwave data + +# if False: + if EEG_data_source == 'Mind Monitor': + + data_keys = ['Delta_TP9', 'Delta_AF7', 'Delta_AF8', 'Delta_TP10', + 'Theta_TP9', 'Theta_AF7', 'Theta_AF8', 'Theta_TP10', + 'Alpha_TP9', 'Alpha_AF7', 'Alpha_AF8', 'Alpha_TP10', + 'Beta_TP9', 'Beta_AF7', 'Beta_AF8', 'Beta_TP10', + 'Gamma_TP9', 'Gamma_AF7', 'Gamma_AF8', 'Gamma_TP10'] +# y = ((x + 1.0) * 50) + + for data_col in data_keys: + muse_EEG_data[data_col] += 1.0 + muse_EEG_data[data_col] *= 50. + + elements_df = pd.DataFrame(muse_EEG_data, columns=['TimeStamp', 'Elements']) if Verbosity > 1: @@ -1053,12 +1072,17 @@ def write_hdf5_data(muse_EEG_data, data_fname): ''' def scale(x, out_range=(-1, 1), axis=None): + + # Get the min and max of the data domain = np.min(x, axis), np.max(x, axis) + # Normalize to +-0.5 y = (x - (domain[1] + domain[0]) / 2) / (domain[1] - domain[0]) + # Scale and add offset return y * (out_range[1] - out_range[0]) + (out_range[1] + out_range[0]) / 2 + ''' Tail-rolling average transform diff --git a/setup.py b/setup.py index 60ea93d..4bbf962 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,7 @@ setup( name="Muse-Analysis-Tools", - version="1.1.1", - + version="1.1.2", author="debra_peri", # author="Debra Grace Peri",