Neuroscan sampleblocksize issue

Forum for software developers to discuss BCI2000 software development
Locked
shjlynn
Posts: 22
Joined: 27 Dec 2010, 08:28

Neuroscan sampleblocksize issue

Post by shjlynn » 18 Jul 2012, 16:59

I met the below problem when I changed the "SampleBlockSize" in Operator interface from the default number 40 to others, like 80, 100.

DataIOFilter::Preflight: NeuroscanADC:: A necessary condition is violated. Please make sure that the following is true :
Parameter("SampleBlockSize")==blocksize.

what I need to do to solve this problem? thx

HJ

mellinger
Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: Neuroscan sampleblocksize issue

Post by mellinger » 19 Jul 2012, 06:56

The SampleBlockSize parameter must match the number of samples per block, as sent by the Neuroscan Acquire software. If you cannot change that in Neuroscan Acquire, you will need to stay with a SampleBlockSize of 40.

The reason is that it makes no sense to break up the amplifier's sample blocks into smaller units of data because this would not be possible to implement without introducing irregular timing, and also because it would introduce additional delay between data acquisition and processing.

SampleBlockSizes which are an integer multiple of 40 would be possible but there is little to gain from. Why would you prefer a SampleBlockSize of 120 over a SampleBlockSize of 40?

Best regards,
Juergen

shjlynn
Posts: 22
Joined: 27 Dec 2010, 08:28

Re: Neuroscan sampleblocksize issue

Post by shjlynn » 19 Jul 2012, 11:31

Juergen,
I've tried use integer multiple of 40, like 80,120,200. But there is still this problem.
And also I can't find place to change the sampleblocksize in Acquire 4.3.

I'm testing my new algorithm which used the a bunch of frequency bands from 6.0—30.0Hz, for the low frequency band, I think SampleBlockSize=40 is not time long enough to extract the pattern(Frequency band evelopes). So I want to try whether SampleBlockSize > 40 will be better.

HJ
mellinger wrote:The SampleBlockSize parameter must match the number of samples per block, as sent by the Neuroscan Acquire software. If you cannot change that in Neuroscan Acquire, you will need to stay with a SampleBlockSize of 40.

The reason is that it makes no sense to break up the amplifier's sample blocks into smaller units of data because this would not be possible to implement without introducing irregular timing, and also because it would introduce additional delay between data acquisition and processing.

SampleBlockSizes which are an integer multiple of 40 would be possible but there is little to gain from. Why would you prefer a SampleBlockSize of 120 over a SampleBlockSize of 40?

Best regards,
Juergen

mellinger
Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: Neuroscan sampleblocksize issue

Post by mellinger » 19 Jul 2012, 11:54

I've tried use integer multiple of 40, like 80,120,200. But there is still this problem.
Sorry, this was an ambiguity in my writing. I meant that integer multiples of 40 would pose no problem to implement, but they are still disallowed by the code.
I'm testing my new algorithm which used the a bunch of frequency bands from 6.0—30.0Hz, for the low frequency band, I think SampleBlockSize=40 is not time long enough to extract the pattern(Frequency band evelopes). So I want to try whether SampleBlockSize > 40 will be better.
Good practice is to use an internal buffer inside your filter to make it independent of system block size. For each block of incoming data, move the existing data by the amount of new data arrived, and fill the resulting free space with the new data. Then, run your analysis on that buffer, which you may choose to be as large as you like.

Regards,
Juergen

shjlynn
Posts: 22
Joined: 27 Dec 2010, 08:28

Re: Neuroscan sampleblocksize issue

Post by shjlynn » 19 Jul 2012, 13:20

Juergen,

thank you for your suggestion. I think it is very useful.
But I still have the following question, because I'm not so familiar with the BCI2000 code:

If I design an internal buffer which can contain 2-3 blocks of SampleBlockSize data, so during the BCI system operating process, at least I'll hold the data in Signal Process Module for 2-3 system circle time with doing any signal process, and thus data won't be passed to next filters and Application Module, in such case, Source Module won't receive the state vector from Application Module, so will the Source Module still send the next block of data to Signal Processing Module??

Best

HJ

mellinger
Posts: 1163
Joined: 12 Feb 2003, 11:06

Re: Neuroscan sampleblocksize issue

Post by mellinger » 19 Jul 2012, 13:44

You will need to initialize the buffer somehow, e.g. by setting its contents to zero. Each time a block of data comes in, put it into the buffer after shifting the buffer's contents, then run your analysis over the current buffer content, and output the result. Each time a block of data enters your filter, a result needs to leave the filter. Don't worry whether the data are calculated from a not-yet filled buffer -- in a correctly designed BCI system, these invalid data cannot enter into classification anyway.

HTH,
Juergen

Locked

Who is online

Users browsing this forum: No registered users and 3 guests