Cursor Task Data Files Truncated?

Forum for discussion on different signal processing algorithms
Locked
kbabalola
Posts: 3
Joined: 26 May 2008, 12:50

Cursor Task Data Files Truncated?

Post by kbabalola » 30 Jan 2011, 23:32

I am running statistics on raw EEG signals produced while running the Cursor Task. I noticed, however, that the output file is significantly smaller than it should be for a 10min run with 256Hz sampling. The output is only the equivalent of 82sec, so I am assuming it has be down-sampled. Are the EEG samples only recorded after a Sample Block is processed (SampleBlockSize = 32)? Or was the data recording just cut off after 32sec without any indication from the Operator? How do I calculate the number of samples associated with each trial (20 trials 25sec each)? Any help would be very much appreciated!

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

Post by mellinger » 31 Jan 2011, 05:15

When you open a BCI2000 dat file in a text editor, you will see an entry HeaderLen= xyz in the first line. Subtract this number (the file header length) from the number of bytes in the file to get the amount of signal data present. Divide this by the number of channels, and by the number of bytes per stored value (2 for 16-bit data, 4 for float and 32-bit integer data) to get the number of samples in the file. Divide the number of samples by the sampling rate to get the recording length in seconds.

To calculate the number of samples associated with a trial of 25s, multiply by the sampling rate, e.g. 25s * 256Hz = 6400 samples. To calculate a file size from this, multiply by the number of channels and the number of bytes per value, e.g. 6400 samples * 8 * 2 = 102.400 bytes. Multiplying by the number of trials, you get 2.048.000 bytes, or about 2MB, as a file size.

HTH,
Juergen

kbabalola
Posts: 3
Joined: 26 May 2008, 12:50

Post by kbabalola » 31 Jan 2011, 08:13

Thank you for your response, but my issue is not trying to determine the file size, it is that the file is too small for a run of twenty 25s trials. I should have 20*25*256 = 128000 samples, but I only have 21024.

My question is does the Cursor Task only record data after each processing block? For instance, if there is a sample block size of 32, does BCI2000 only record data eight times per second? Or does Cursor task just cut off recording randomly without suspending the program itself (meaning while I was running subjects, I had no indication that BCI2000 stopped recording, because it did not cut off)? I just need to know what the recording method is, so that I know how to proceed with my analysis.

In a nutshell, is the Cursor Task output down-sampled (if so, how) or is it just been cutoff early? Is there a simple way of figuring this out from the parameter files?

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

truncated files

Post by gschalk » 31 Jan 2011, 11:58

Hi,

BCI2000 always streams the complete EEG record to disk, no matter what signal processing or application module you are running. Thus, the length of the data file needs to equal the length of the recording, or else something is seriously wrong.

What device are you using to collect data? Are you using a stock BCI2000 system or a system with modifications? Can you send a parameter file?

Gerv

kbabalola
Posts: 3
Joined: 26 May 2008, 12:50

Post by kbabalola » 31 Jan 2011, 13:43

We developed a system that controls an external device via UDP. The systems sends the x, y and currentrunning state variables back and forth between BCI2000 and a robot. The upper and lower targets of Cursor Task were mapped to targets in the robot space, however to make the two systems run simultaneously, we had the robot toggle the currentrunning variable to reset BCI2000.

Could it be that BCI2000 is overwriting each previous trial when we have the system reset? Is the data output timestamped somehow? I am looking at the file that was converted to ASCII via BCIExport; does that remove something from the original .dat file? Also, I can send you a sample parameter file; where shall I send it?

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

robot

Post by gschalk » 31 Jan 2011, 17:34

Hi,

I do not understand why you need to "reset" BCI2000. If you set the state Running to 0, BCI2000 (and data recording) actually stop. If you just want the output of signal processing, you should look at Signal(0,1) and Signal(1,1) and not CursorPosX and CursorPosY.

Gerv

Locked

Who is online

Users browsing this forum: Bing [Bot] and 1 guest