Skip to content
Snippets Groups Projects
Commit bcd351a4 authored by ofplarsen's avatar ofplarsen
Browse files

Fixed for both files

parent b75441f8
No related branches found
No related tags found
No related merge requests found
......@@ -109,7 +109,7 @@ inlet_2 = StreamInlet(streams_eeg[0])
fs = 250 # Sampling frequency
delay = 0.01
delay = 0.061
fragment_duration = 4+delay # Fragment duration in seconds
print(fragment_duration)
fragment_samples = round(fs * fragment_duration)
......@@ -139,7 +139,7 @@ while True:
# 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)
if (len(buffer) == fragment_samples) and buffer[0][0] == 1:
if (len(buffer) == fragment_samples) and buffer[0][0] == 1 and buffer[0][fragment_samples-round(delay*fs)] <= 0:
print(len(buffer))
fragment = np.array(buffer[:fragment_samples])
fragment_eeg = np.array(buffer_eeg[:fragment_samples])
......
......@@ -214,7 +214,7 @@ while True:
# 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)
if (len(buffer) == fragment_samples) and buffer[0][0] == 1 and buffer[0][fragment_samples] <= 0:
if (len(buffer) == fragment_samples) and buffer[0][0] == 1 and buffer[0][fragment_samples-round(delay*fs)] <= 0:
print(len(buffer))
fragment = np.array(buffer[:fragment_samples])
fragment_eeg = np.array(buffer_eeg[:fragment_samples])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment