open-ephys / acquisition-board

Hardware interface for streaming up to 512 channels of neural data via USB
https://open-ephys.github.io/acq-board-docs/
Other
51 stars 29 forks source link

Strange "clipping" noise #23

Closed justidy1 closed 8 months ago

justidy1 commented 1 year ago

Hi OpenEphys Team,

We have been encountering a strange issue that we think is originating from the board. Below is a screenshot of a single channel data acquired from a 64 ch linear probe with Intan headstage. The data was sampled at 30 kHz in Bonsai and rescaled from binary unit16 to µV, time is in seconds. As you can see, there is a "clipping" or "step-like" noise. It seems to persist throughout all the recordings & in particular in the bottom ~16 channels or so.

Screen Shot 2023-08-23 at 11 23 29 AM

The reason why we think it has to do with the board (and not Bonsai) is since we see a similar pattern of noise in the OpenEphys GUI, and we even see it in another other board using Intan headstage for tetrodes. The unaffected channels have great signal, however. Obvious sources of external noise have been reduced as much as possible (Faraday cages, anti-static, grounding).

Since it looks like discrete chunks of data being out of place, my initial thought is this could be something to do with the multiplexing? Any advice or fixes for this issue would be greatly appreciated.

Thanks!

jsiegle commented 1 year ago

Have you tested whether this clipping occurs with more than one headstage? And does it persist for all of the SPI input ports (A, B, C, and D)? Since it's happening around 0 uV, it should be possible to check for it with a probe in saline.

justidy1 commented 8 months ago

I just want to provide an update to what we believe to be the issue here and how we fixed it for the time being.

The key component was realizing that it persisted across different acquisition boards, across all SPI ports, different cables, different computers, and whether or not the headstage was attached to a probe. It only occurred in Bonsai, which made us think of a software issue.

After some further digging, we found this Google Group thread on Bonsai which seemed to have a related bug to what we were seeing: https://groups.google.com/g/bonsai-users/c/r6hcBT0vdGg/m/DCi5K4X7LwAJ

It seems that Bonsai is not estimating the CableDelay parameter correctly in its Rhd2000EvalBoard object, causing a shift in the binary stream (or at least this is how I understand it). Setting the delay to a value of 4 solved it for us. Delays that were different than 4 introduced more clipping noise or failed to eliminate the noise.

To make a long story short, this appears to be issue that is isolated to Bonsai the Rhd2000EvalBoard object.

jsiegle commented 8 months ago

Glad you were able to track this down and find a solution! Can you post an issue about it here as well? https://github.com/bonsai-rx/ephys/issues

They may be able to push a fix to the Bonsai ephys package.