reading bdf+ files?

Thomas Hartmann thomas.hartmann at UNI-KONSTANZ.DE
Mon Mar 8 10:30:31 CET 2010


hi robert,
thanks for the quick answere.
yes, bdf+ is bdf with an annotation-channel added. this channel is
unlike the bdf trigger channel. so this, as i had already expected,
explains the problem.

my major motivation for using bdf+ is the availability of a ready-to-use
c++ library. unfortunatly it only writes bdf+ or edf+, not the
"standard" format.

does someone know of a stable, well-documented, free library (c or c++)
to write eeg-data in a format, fieldtrip can read?

cheers,
thomas

Am 08.03.2010 09:27, schrieb Robert Oostenveld:
> Hi Thomas,
>
>
> On 5 Mar 2010, at 17:02, Thomas Hartmann wrote:
>
>> hi,
>> i try to read bdf+ files created using edflib
>> (http://www.teuniz.net/edflib/)
>>
>> although the file looks good in the reader, fieldtrip complains about
>> "channels with different sampling rate not supported". i debugged the
>> code. the error occurs because bdf+ files have an additional channel
>> storeing events. this one seems to have a different samplerate.
>>
>> i disabled these checks which resulted in a new error-message:
>> "One ore more output arguments not assigned during call to
>> "read_24bit"."
>>
>> is the support of fieldtrip restricted to bdf and not bdf+-files? or
>> is there something wrong with the lib i use to write the file?
>
> I don't know the details of the bdf+ format, but do know the bdf
> format. Probably bdf+ is plain bdf with an annotation channel. Are you
> using annotations? The biosemi system does not, it uses a non-standard
> trigger channel sampled at the same frequency as all other channels
> (i.e. "non standard" meaning that it does not comply with the
> published papers on edf and edf+). Having a trigger channel at the
> same sampling rate makes the implementation of software and hardware
> and interpretation of the data much simpler.
>
> In general data is desribed as Nchan X Nsamples matrix. If one of the
> channels has another sampling rate, it does not fit in this matrix,
> that is why varying sampling rates over channels are not supported. If
> the event/status/trigger channel is represented as a continuously
> sampled channel (like in bdf), it is read along with all other
> channels. The same limitation applies to edf and edf+. The annotation
> channel is difficult to deal with and in the read_biosemi_bdf
> implementation not supported.
>
> The bdf format has small blocks (usually one second long) in which the
> channels are stored like
> ch1_1 ch1_2 ch1_3 ... ch2_1 ch2_2 ch2_3 ...
> i.e. all samples of one channel as a vector, and then the next
> channel. This allows for variable sampling rates, whereas a
> multiplexed representation would not. Specific for the bdf format is
> that the samples are represented as 24 bit (where 32 bit is more
> usual). The read_24bit mex file reads such a block and converts the 24
> bit values to doubles. The reason for having it in a mex file is that
> the conversion from 24 bits to double is much more efficient.
>
> best regards
> Robert
>
> ----------------------------------
> 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.


--
Dipl. Psych. Thomas Hartmann

OBOB-Lab
University of Konstanz
Department of Psychology
P.O. Box D25
78457 Konstanz
Germany

Tel.: +49 (0)7531 88 4612
Fax: +49 (0)7531-88 4601
Email: thomas.hartmann at uni-konstanz.de
Homepage: http://www.uni-konstanz.de/obob

"I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan Doyle)

----------------------------------
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.



More information about the fieldtrip mailing list