CerebusOSS/CereLink

Continuous analog data are different if extracted using c++ code or openNSx.m in Matlab

Opened this issue · 3 comments

Hi,

I managed to extract real-time analog input data on my c++ code on Visual Studio. I use an existing recording played back on NPlayServer.
What I did is to get the analog input samples and copy them into a .txt file, in an iterative process. When I plot them, they look similar to the signal displayed on Central, using the NPlayServer.

Instead, when I extract the data directly from the recording file using openNSx.m in Matlab, the data look different (Figures 1 and 2 ). Most of the time the data saturates.
It almost seems that the c++ dataset is the filtered version of the matlab dataset.

noisedata
Figure 1: noisy dataset (blue: extracted using matlab; red; extracted using c++ code)

recdata
Figure 2: muscle contraction dataset (blue: extracted using matlab; red; extracted using c++ code)

Let me know if you may have ideas of why it happens.

Thanks in advance,
Flavio

It looks like data corruption when read by openNSX, I do not think it is related to filters

Also you can capture the raw, that will not be filtered for certain and you can then compare.