Trial-by-trial variability in latency
Aim: Estimating the fixed and variable signal latency for the
following:
- Psychopy stim computer
- Standalone EEGO system
- LSL
triggers
- LSL recorder
Experiment 1 (variability in the recording of triggers, and fixed
latency for the LSL trigger):
Design in Psychpy a for loop fixed 1sec delay. Repeat for 100 trials
Recorder with EEGO the following sets:

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 998 1000 1000 1000 1000 1000

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 996 1000 1000 1000 1002 1002
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 6.00 12.00 12.00 12.16 14.00 16.00

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 6.00 12.00 12.00 12.16 14.00 16.00
B. Repeat with LSL recorder:

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 999.5 999.6 999.7 999.7 999.8 1000.6
Experiment 2:Send a trigger and produce a white screen for 1sec.
Then a black screen for 4sec. Repeat for 100 trials.

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 14.00 30.00 34.00 34.32 40.00 44.00

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 14.00 29.50 34.00 32.96 36.00 44.00

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 38.00 45.50 48.00 49.02 52.00 60.00

## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 44.00 50.00 54.00 53.82 58.00 64.00
Analysis
#effect of lsl triggers
hist(latencies_pd_eego_lsl-latencies_pd_eego_ttl)

mean(latencies_pd_eego_lsl-latencies_pd_eego_ttl)
## [1] 14.7
#effect of lsl recorder
hist(latencies_pd_lsl_lsl-latencies_pd_eego_lsl)

mean(latencies_pd_lsl_lsl-latencies_pd_eego_lsl)
## [1] 4.8
hist(latencies_pd_lsl_ttl-latencies_pd_eego_ttl)

mean(latencies_pd_lsl_ttl-latencies_pd_eego_ttl)
## [1] -1.36
#effect of lsl trigger under lsl recorder
hist(latencies_pd_lsl_lsl-latencies_pd_lsl_ttl)

mean(latencies_pd_lsl_lsl-latencies_pd_lsl_ttl)
## [1] 20.86