Skip to content
Snippets Groups Projects
Commit 8b71e0b3 authored by William G. Tresselt's avatar William G. Tresselt
Browse files

Resolved merge conflict

parents 7271a1e2 f945db35
No related branches found
No related tags found
No related merge requests found
...@@ -193,7 +193,12 @@ inlet_2 = StreamInlet(streams_eeg[0])# LSL EEG data ...@@ -193,7 +193,12 @@ inlet_2 = StreamInlet(streams_eeg[0])# LSL EEG data
fs = 250 # Sampling frequency fs = 250 # Sampling frequency
delay = 0 #Occular delay delay = 0 #Occular delay
#delay = 0.00 #Occular delay #delay = 0.00 #Occular delay
fragment_duration = 6+delay # Fragment duration in seconds sync_delay = 0.061 #sync delay
ocular_delay = 0.100 # Ocular delay
#fragment_duration = 6+delay # Fragment duration in seconds
fragment_duration = 4 + sync_delay + ocular_delay # Fragment duration in seconds
fragment_samples = round(fs * fragment_duration) fragment_samples = round(fs * fragment_duration)
...@@ -218,8 +223,9 @@ while True: ...@@ -218,8 +223,9 @@ while True:
# If buffer is filled with data ready to be compared in CCA, and the start of the buffer is the start of # If buffer is filled with data ready to be compared in CCA, and the start of the buffer is the start of
# the Eye Tracking data (Eye Tracking trigger) # the Eye Tracking data (Eye Tracking trigger)
if (len(buffer) == fragment_samples) and (buffer[0][0] == 1): if (len(buffer) == fragment_samples) and buffer[0][round(ocular_delay*fs)] == 1 and buffer[0][fragment_samples-round(sync_delay * fs)] != 0:
if(buffer[fragment_samples - round(delay * fs)-1][0] != (fragment_samples-round(delay * fs))): # This prob not working :P
if(buffer[fragment_samples - round(sync_delay * fs)-1][0] != (fragment_samples-round(sync_delay * fs))):
print("Found invalid stare") print("Found invalid stare")
continue continue
...@@ -250,9 +256,12 @@ while True: ...@@ -250,9 +256,12 @@ while True:
print("--- Filter time: %s seconds ---" % (time.time() - start_time)) print("--- Filter time: %s seconds ---" % (time.time() - start_time))
print(df['N'].tolist()) print(df['N'].tolist())
df['N'] = df['N'].shift(-round(ocular_delay * fs))
# If any delay added, shift signal accordingly # If any delay added, shift signal accordingly
df['N'] = df['N'].shift(round(delay*fs)) df['N'] = df['N'].shift(round(sync_delay * fs))
df = df.iloc[round(delay*fs):] df = df.iloc[round(sync_delay * fs):]
# Reset the index # Reset the index
df = df.reset_index(drop=True) df = df.reset_index(drop=True)
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment