Biosemi data format/Reading .bdf into Matlab

Post Reply
RicardaBraukmann
Posts: 4
Joined: Tue Sep 23, 2014 10:08 am

Biosemi data format/Reading .bdf into Matlab

Post by RicardaBraukmann » Tue Sep 23, 2014 10:40 am

Hi everyone,

I am new to Biosemi and I have a couple of question regarding the Biosemi data format and reading in .bdf files into Matlab.
I would like to use Fieldtrip, a Matlab toolbox for EEG analysis (see http://fieldtrip.fcdonders.nl/), to analyze my data, but I am encountering some problems when trying to read in raw biosemi data (.bdf).

The main thing is that the data looks odd to me as the vertial scale is very large [ -178000 178000 ], but also filtering and trial selection does not work properly.

From what I have read so far about Biosemi, I suspect that this might have to do with the DC-offset and that I might have to re-reference the data. I tried this using one of the EXG channels ('EXG5'), but this did not help.
I am afraid that I dont fully understand Biosemi data and it would be great if someone could give me some more insights into this matter.

- Is this scaling problem indeed caused by the offset/Do I indeed need to re-reference the data before I can use it in Matlab?
- If so, what should be used as a reference?
- In addition, I was wondering if someone could explain to me what these EXG channels (there are 8 of those in my data) are exactly?


Since I wasn't able to work with the .bdf files, I tried to convert them to .edf (using the converter from http://www.biosemi.com/download/).
This .edf file looks much more normal in Fieldtrip, but the data is still very noisy and I still encounter some problems, especially when trying to filter the data. When applying a high-pass filter (0.5Hz) on the data for example, Matlab gives an error reporting unstable poles.

- I was not sure whether I need to re-reference this .edf file as well (which leads again to my question about re-referencing and the EXG channels)
- Any additional suggestions on why I might have problems with filtering are of course also very welcome!

In addition, I am curious what exactly happens to the data when it is converted from .bdf to .edf, so additional information on this would also be very much appreciated.

Many Thanks in advance!
Best,
Ricarda

Coen
Site Admin
Posts: 892
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Re: Biosemi data format/Reading .bdf into Matlab

Post by Coen » Tue Sep 23, 2014 1:58 pm

Large scale is due to offsets, y-scale values are probably still unscaled (probably 1 unit = 1 LSB = 1/32th uV)

Referencing is always necessary (see http://www.biosemi.com/faq/cms&drl.htm), you should be able to do this after importing the file in Fieldtrip.

EX channels are 8 extra channels with (usually) flat type electrodes, used for EOG, ECG, EMG or mastoid references

BDF --> EDF applies an (adjustable) high-pass, and converts from 24 to 16 bits with adjustable LSB value.

Best regards, Coen (BioSemi)

RicardaBraukmann
Posts: 4
Joined: Tue Sep 23, 2014 10:08 am

Re: Biosemi data format/Reading .bdf into Matlab

Post by RicardaBraukmann » Wed Sep 24, 2014 10:54 am

Dear Coen,

Thanks for the clarifications.

I have two other questions.

- First, I was wondering what re-reference you would suggest. Would it be best to re-reference to the average?

Then, I also experience some problems with the markers that are read into Matlab. The codes we send (also using Matlab) during the experiment, do not match the codes that I see back in my data after reading it in.

For example, we have send a 103 originally and after reading in, I see 65383 instead.
Do you have any idea what might be causing this and how it can be adjusted?

Thank you very much for your help!
Best,
Ricarda

Coen
Site Admin
Posts: 892
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Re: Biosemi data format/Reading .bdf into Matlab

Post by Coen » Wed Sep 24, 2014 12:06 pm

Reference choice depends on the sort of analysis you want to do. Typical reference choices are: average of all electrodes, a single electrode like Cz, or the average of 2 flat (EX) electrodes behind the ears (mastoid reference, virtual point in the center of the head).

There are 16 trigger lines (bits), see http://www.biosemi.com/faq/trigger_signals.htm. In "analog" display mode, ActiView displays the 16 separate bits as colored bars or dots. In "digital" display mode, ActiView displays the triggers as two separate bytes (trig 1-8 and trig 9-16). So you will two groups of numbers each in the 0-255 range. Your Matlab program apparently shows a single 16 bit number in the 0-65535 range. Split the 16 bit word in 2 bytes, and you will see the same values as in ActiView.

Best regards, Coen (BioSemi)

RicardaBraukmann
Posts: 4
Joined: Tue Sep 23, 2014 10:08 am

Re: Biosemi data format/Reading .bdf into Matlab

Post by RicardaBraukmann » Wed Sep 24, 2014 1:44 pm

Thanks you very much for this fast clarification! This does solve my problem with the markers!

RicardaBraukmann
Posts: 4
Joined: Tue Sep 23, 2014 10:08 am

Re: Biosemi data format/Reading .bdf into Matlab

Post by RicardaBraukmann » Wed Sep 24, 2014 6:00 pm

Hi again,

Sorry for the inconvenience, but I just have one final question about the scaling of the data and the use of the converter.
Matlab does not automatically detect the scale of the data of the raw .bdf file but I would want to have the data displayed in uV.

I am understanding it correctly that I can use the converter to rescale the data? So if I chose the EDF setting LSB value 1.0 uV (66mVpp range) does that then mean that the scale of the .edf data will be (1) uV?

Thanks a lot for the clarification!
Ricarda

Dritan
Posts: 2
Joined: Thu Aug 31, 2017 7:46 pm

Re: Biosemi data format/Reading .bdf into Matlab

Post by Dritan » Fri Mar 09, 2018 11:57 am

Coen wrote:
Wed Sep 24, 2014 12:06 pm
Split the 16 bit word in 2 bytes, and you will see the same values as in ActiView.

Best regards, Coen (BioSemi)
Hi Coen, how can we do that? Split the 16 bit word in 2 bytes of 8 bits?

Coen
Site Admin
Posts: 892
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Re: Biosemi data format/Reading .bdf into Matlab

Post by Coen » Fri Mar 09, 2018 5:37 pm


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest