time information for the data file

Forum for discussion on different signal processing algorithms
Locked
Yueqing Li
Posts: 51
Joined: 08 May 2007, 16:41

time information for the data file

Post by Yueqing Li » 12 Jan 2009, 16:32

Hi:

I met some problems in the time information of the EEG data file. I have recorded one EEG data file. The file properties (right click the data file, then choose the properties) show that the real windows time is from 4:07:14 PM to 4:10:09 PM, which means the total recording time is 175 seconds.

However, using the BCI2000 Viewer, we found that the recording time is 172 seconds. In fact, there is still a small time slot without time scale. I think it is less than 1 second. So, the total time will be between 172 seconds and 173 seconds.

Then I tried the mex in the BCI200 tools, and found the data file in fact includes 44184 samples. Since we use a sampling rate of 256, so the total time is 44184/256 = 172.59375 seconds.

The BCI2000 Operation Module also showed the data recording time is 172 seconds.

It seems they don't display the same time length. So, which one is correct? And, is there any way I can get more time information in milliseconds? Thanks a lot.

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

times

Post by gschalk » 12 Jan 2009, 17:00

Yueqing,

There is another way to assess the time. In the data file, there is a state SourceTime that defines the time a particular block of data was acquired in ms. This time is defined using the Windows high performance timer, and thus very accurate.

For most purposes, I would simply go with the number of samples/265. I would not look at the Windows file properties as this may depend on when Windows actually opened the file (which is a little before system operation starts) and closes (which may be a little after it ended).

Gerv

Yueqing Li
Posts: 51
Joined: 08 May 2007, 16:41

time information about EEG data recording

Post by Yueqing Li » 13 Jan 2009, 17:00

Hi, Dr. Schalk:

Thanks for your help. I got the same time length with both ways.

I have another question:

I tried your Maxifred and it works perfect. But the beginning point is 0, not real windows time (for example, 3:59:31 PM). So, is there any way that I could get the exact beginning point and ending point of the EEG recording in real windows time in milliseconds? Thanks.

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

Viewer ...

Post by gschalk » 13 Jan 2009, 17:39

Yueqing,

You may want to try BCI2000Viewer, which is now included instead of Maxifred. If this does not do what you are interested in, you may want to write a simple Matlab program.

Gerwin

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

Post by mellinger » 14 Jan 2009, 06:52

Yuequing,

you might be interested to know that in BCI2000 V2, the StorageTime parameter will reflect date and time of the recording's beginning (albeit with second resolution rather than milliseconds).

HTH,
Juergen

Yueqing Li
Posts: 51
Joined: 08 May 2007, 16:41

time information

Post by Yueqing Li » 15 Jan 2009, 14:19

Dr. Schalk:

I think I want to code a matlab program to get the windows time information of the EEG data file. Could you please to give me some small hint? I know there are some time functions in matlab, but have never coded such programs. Thanks a lot.

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

Matlab ...

Post by gschalk » 20 Jan 2009, 15:07

Yueqing,

I would go to one of the many introductory Matlab tutorials on the Internet to get started on Matlab.

Then, what you will need to do is to load a particular BCI2000 data file using the load_bcidat Matlab routine (in \tools\mex, you can get help using 'help load_bcidat') and then do calculations on the SourceTime and StimulusTime states, e.g.,

[ signal, states, parameters ] = load_bcidat( 'test.dat' );

time_diff=states.SourceTime-states.StimulusTime;

plot(time_diff);


I hope this helps.

Gerv

Yueqing Li
Posts: 51
Joined: 08 May 2007, 16:41

Post by Yueqing Li » 24 Jan 2009, 18:36

Thank you very much, Dr. Schalk.

Locked

Who is online

Users browsing this forum: No registered users and 4 guests