-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-1404: Handle monitor delay errors
Previously we used consective photodiode edges of the same type to determine whether an event is a valid transition. This led sometimes to missing out on the final valid event, and resulted in an error ("stimulus transitions" and "photodiode events" did not have the same length). The algorithm has been updated to use consecutive events as described below: From @dougo: 1. Every transition from rise/fall or fall/rise represents a change in the state of the sync square. Call these ‘photodiode events’ 2. During the experiment, the sync square changes state every N frames (where N = 60 by default). Let’s call these ‘sentinel frames’ 3. A transition marks a ‘sentinel frame’ if the next photodiode transition is roughly 1.0s after the previous OR 1.0s before the next (for N = 60 frames at a 60 Hz display rate). Call these ‘valid transitions’ He also notes that the time delay between each ‘valid transition’ and each ‘sentinel frame’ should be roughly constant (mean between 20 and 40 ms, std of just a few ms for a given experiment) Update the logging to show the min, max, and std delay. No longer use a default value, but throw an error if there are data issues or the value computed is outside expected range.
- Loading branch information
1 parent
cc6e387
commit e788176
Showing
2 changed files
with
128 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters