bdf import, 16 bits events

Nicolas Robitaille nicolas.robitaille at UMONTREAL.CA
Tue Jan 19 18:02:52 CET 2010


Hi Clemens,

I've encounter a similar problem. Biosemi actually merge the data as if this was a single 16-pins triggers, so a number between 0 and 65535. You could dissociate these two number and get back your two independent values with something like:

t = dec2bin(yourTrigValue,16)
lowerPort = bin2dec(t(9:16))
higherPort = bin2dec(t(1:8))

so both values will be between 0 and 255.

Something you must carefully think about, however, is that you may get much more trig that you actually send. For example, you likely gonna get consecutive identical events on the lower port, which were originally recorded as as separate events because something happen on the higher port. Same will happen for the 0 you likely send between each code, independently on each port, to put all the pins down.

Hope this help,

Nicolas

p.s. there could be a more computationally-efficient way to do this.

*************************
Nicolas Robitaille, Ph.D.
Stagiaire post-doctoral
Brams
*************************




Date: Tue, 19 Jan 2010 18:31:56 +0200
From: clemens.maidhof at HELSINKI.FI
Subject: [FIELDTRIP] bdf import, 16 bits events
To: FIELDTRIP at NIC.SURFNET.NL








Dear Fieldtrip users,




we are using 16 Bits for coding events in BDF data (i.e., all 16 pins
for trigger input of the BioSemi connector used; 8 Bits for
Presentation and 8 Bits for another device). However, when importing
the bdf-file with Fieldtrip into EEGLAB (v7.2.8.18b, Matlab 7.0.8), all
event codes with a value higher than 28
(from Bits 9-16) seem to be incorrect: these triggers are recognized,
but their value is the sum of an addition of the actual value with a
value from the first 8 bits.


During recording, the BioSemi software shows the correct events in the
acquisition software, and also when imported into BESA all correct
event codes are there. So we thought this has probably to do with the
import-function in fieldtrip.




Has anybody encountered the same problem or maybe even better, knows a
solution  ;-)  ?




Thanks a lot in advance for any hints and tips!


Clemens


-- 

Clemens Maidhof
Cognitive Brain Research Unit, Department of Psychology, University of
Helsinki & Finnish Centre of Excellence in Interdisciplinary Music
Research, University of Jyväskylä, Finland 
clemens.maidhof at helsinki.fi


----------------------------------

The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.

  http://listserv.surfnet.nl/archives/fieldtrip.html

  http://www.ru.nl/fcdonders/fieldtrip/
 		 	   		  
_________________________________________________________________


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100119/6d68c0b5/attachment-0001.html>


More information about the fieldtrip mailing list