Timig problem

Forum for software developers to discuss BCI2000 software development
Post Reply
KyunghoWon
Posts: 8
Joined: 03 Jan 2016, 21:54

Timig problem

Post by KyunghoWon » 15 Feb 2016, 23:20

Hello,

I am trying to add new source module to BCI2000.

First of all, my environment is,

Windows 7 Home 64bit, Intel Core(TM) i7-3610QM CPU, 8 GB memory, and Visual studio 2012 Ultimate

Problem

When I launch signal source(new module), processing(dummysignalprocessing),
and application(stimulus presentation) using BCI2000Launcher.exe(config -> set config),

the timing is incorrcetly faster than 1s, and I used stimulus presentation for 5000ms, it seemed that stimulation appeared for only 2.5 ~ 2.8s.
After I checked the data using Matlab, the amount of data was the same as the product of samplig rate and proper time.

When I reduced samplig rate, the timing got faster, and the timing got slower when I increased the samplig rate.

Is new source module wrong?

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Timig problem

Post by pbrunner » 16 Feb 2016, 09:51

KyunghoWon,

to get a better idea of the issue, can you please post a screenshot of the timing window as well as a dropbox link to a data file that you have collected with your source module?

Regards, Peter

KyunghoWon
Posts: 8
Joined: 03 Jan 2016, 21:54

Re: Timig problem

Post by KyunghoWon » 16 Feb 2016, 10:44

Hello,

Here is the data file that I collected with new module.

I recorded the video when I launched BCI2000Launcher.exe.

https://drive.google.com/file/d/0By3T8V ... sp=sharing

https://drive.google.com/file/d/0By3T8V ... sp=sharing

https://drive.google.com/file/d/0By3T8V ... sp=sharing
* I added operator system log

I set 512Hz samplig rate and 5000ms stimulus.

Data amount looks correct, but actual time length was incorrect when I launched stimulus presentation.

I only connected the device itself for testing, so the value would be meaningless.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Timig problem

Post by pbrunner » 17 Feb 2016, 14:07

KyunghoWon,

thanks for posting the video and data file. I now understand the issue that you are experiencing.

One thing that you need to understand is that the source module serves as the clock for the BCI2000 system. In your situation, the source module needs to deliver 32 data samples per channel every 1/16th of a second. Obviously this is currently not the case. The culprit of this can be in the method in how you query the data from the acquisition device. There are two query methods that work really well. The first method uses a blocking call to the acquisition device that return always with the last 32 data sample. The second method uses a call back that is issued once 32 data samples are ready. Looking at your video I can see that either the sampling rate is not correct, or you are not getting continuous data. The first step towards debugging this issue, is to attach a signal generator that puts out a sinus with a known amplitude and frequency. You can then in MATLAB analyze the stored data. For example, you can make a diff on the data to see if there are discontinuous jumps. You can also determine the frequency of the input signal, which should match the settings on the signal generator. Let me know what the outcome of this analysis is.

Regards, Peter

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests