def FeatureExtraction(Sample,Feature,Data_Array): # Append the data Data_Array = np.append(Data_Array,Sample,axis=0) # Common Average Reference Sample[:,range(1,9)] = Process.Common_Average_Reference(Sample[:,range(1,9)]) # Feature Extraction if ALPHA: Feature = np.append(Feature,Process.AlphaDifference(Sample,([5,6],[7,8]),250)) else: Feature = np.append(Feature,Process.PowerExtraction(Sample[:,3],[8,12],250)) return (Feature,Data_Array)
while len(Feature) < 5 * TaskSetting['Initiation']: if not Data_Queue.empty(): Sample = Data_Queue.get() if not EEG_Recording.any(): EEG_Recording = Sample else: EEG_Recording = np.append(EEG_Recording, Sample, axis=0) # Common Average Reference Sample[:, range(1, 9)] = Process.Common_Average_Reference( Sample[:, range(1, 9)]) # Feature Extraction if ALPHA: Feature = np.append( Feature, Process.AlphaDifference(Sample, ([5, 6], [7, 8]), 250)) else: Feature = np.append( Feature, Process.PowerExtraction(Sample[:, 3], [8, 12], 250)) FIFO.Rewrite(Trigger_Log, "Calibration On") Trigger = np.array([[len(Feature), CALIBRATION_START]]) print "Calibration Stage 1" Current_Index = len(Feature) """""" """""" """""" """""" """""" """""" """""" """ Resting State. Movement Range Calculation. """ """""" """""" """""" """""" """""" """""" """""" while len(Feature) - Current_Index < 5 * TaskSetting['Calibration']: if not Data_Queue.empty(): Sample = Data_Queue.get()