neurogears / vestibular-vr

Closed-loop VR setup for Rancz Lab
2 stars 0 forks source link

Insertion workflow #40

Closed RoboDoig closed 4 months ago

RoboDoig commented 4 months ago

This PR introduces the separate insertion workflow, including the NstDevice control and visualizer, NPX ONIX logging and functionality to allow rerouting of NPX channels to ONIX analog IO outputs. Also addresses a comment in #32.

A note on the IO rerouting - as the ONIX output does not have a buffer, we are limited to writing 1 sample at a time to each channel. I've done some experiments and this appears to be all the ONIX can do currently. Passing a 12x1 matrix will write each row value to one of the 12 channels, passing a 12x2 matrix will only write the values in the first column. The problem with this is that we are limited practically to just writing samples to the analog IO as fast as we can on receiving them from NPX. Because there is a software step in between receiving NPX sample and writing it to the IO, there will necessarily be some jitter on the time of each sample being written and the sampling rate will be shifted. Need to be aware of this for any interpretation of what comes out of the analog out (e.g. oscilloscope) - analaysis of e.g. frequency bands will be affected by this jitter.