Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does CereLink enable functionality similar to Central's "SingleNeuralChannel"? #71

Open
cboulay opened this issue Mar 8, 2017 · 6 comments

Comments

@cboulay
Copy link
Collaborator

cboulay commented Mar 8, 2017

Hi all,

In Central, there's an app to display activity from a single neural channel. This window is very useful and has 90% of the functionality that I need but unfortunately not quite enough; I have to write my own app. I'm curious about how this window achieves a couple different things.

  1. Even if a channel is not configured to acquire continuous data, the window still displays the continuous data at the bottom. Even if this window is open and displaying continuous data, continuous data does not appear in the raster plot.
  2. Even if a channel is not configured to acquired high-pass filtered data, this window still displays a high-pass filtered signal in the 'Strip' tab from which the threshold can be set.

How is (1) achieved? Does CereLink expose that functionality?

I guess that (2) can be achieved by filtering (1), though this seems dangerous if the filters don't match exactly those used by the NSP because then the threshold set by the user wouldn't perform exactly as expected on the NSP.

@dashesy
Copy link
Collaborator

dashesy commented Mar 9, 2017

There is some for-display data (i.e. low sample rate) that are sent cbPKT_STREAMPREV but CereLink currently does not do anything with it, it is good for display because eye refresh rate us slower. Also, there is a raw channel cbRAWGROUP that can be configured along with the normal sample rate (both at the same time).

Everything should be in cbhwlib somewhere.

@cboulay
Copy link
Collaborator Author

cboulay commented Mar 9, 2017

FYI, the reason I'm pursuing this is because I'm running into performance problems trying to plot 8 channels at 30 kHz + 4 channels at 2 kHz.

Central does not allow configuring a channel to transmit both SDK_SMPGRP_RAW and SDK_SMPGRP_RATE_30k, but RAW and something less than 30kHz is allowed. Is that a limitation of the NSP or just Central?

cbPKT_STREAMPREV sounds interesting. In its definition I don't see any fields that would hold data. Can you indicate which?

The code comments suggest that cbPKT_STREAMPREV.chid should be 0x8000 + channel identifier. It seems like this chid doesn't meet any logical checks in ProcessIncomingPackets (there is no corresponding else for that second if). Would this be the right place to put it? I can attempt this, but I will only bother doing so if this gets me closer to getting easy-to-plot data.

@zeeMonkeez
Copy link

zeeMonkeez commented Mar 11, 2017

Analysing the package traffic it seems like Central sends out a cbPKTTYPE_PREVSET every some 250ms. I didn't see a definition of the packet, but it just seems to be 0x8000 + chid, and empty payload. That gets confirmed by the NSP with cbPKTTYPE_PREVREP, followed by cbPKT_STREAMPREV every 20 ms. I guess Central then calculates the displayed value from rawmin and rawmax?
After the last cbPKTTYPE_PREVSET package was sent from Central (before closing the preview window), cbPKT_STREAMPREV were sent for 1 second, so perhaps cbPKTTYPE_PREVSET don't have to be sent that often.

@dashesy
Copy link
Collaborator

dashesy commented Mar 11, 2017

The comments describe what each field is. For example rawmin and rawmax are the minimum and maximum of the raw channel (the additional raw channel) for that time period (I think around 250ms). Or envmin and envmin are enevelope's min and max (that is shown in threshold). To plot, just plot a bar with those values, and it will look like zoomed-out version of the high sample rate data.
(I think) It is sent only for one channel currently under preview, Central sends some packet to tell which channel is currently open.

Central not configuring SDK_SMPGRP_RAW could be to avoid going above bandwidth I think.

@dashesy
Copy link
Collaborator

dashesy commented Mar 15, 2017

I think monsource is the channel to be monitored

@cboulay
Copy link
Collaborator Author

cboulay commented Mar 15, 2017

Thanks, I'll give it a try later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants