different trigger codes in bdf

Post Reply
ciara123
Posts: 2
Joined: Mon Sep 16, 2019 5:24 pm

different trigger codes in bdf

Post by ciara123 » Mon Sep 16, 2019 5:35 pm

Hi,

I am piloting some EEG tasks (Matlab scripts) and am finding that the trigger codes saved to the .bdf files are different to those I see in the actiview window when collecting data.

For example when running an MMN paradigm, the codes are in the 200's but when I open the .bdf file in eeglab the trigger codes are in the 700s? It seems to be adding 512 to the trigger codes for that task as far as I am aware.

I have tried collecting data using analog and decimal trigger format settings and get the same trigger codes. Just to note, I have also selected erg1 in the auxiliary sensors tab in actiview as we are using a photo sensor for other tasks in the battery.

Is there some other settings I should be using?


Thank you for your help in advance!


Ciara

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

Re: different trigger codes in bdf

Post by Coen » Mon Sep 16, 2019 9:23 pm

Split the 16 bit trigger word in two 8 bit bytes. ActiView does not affect the codes saved in the BDF file.

Best regards, Coen (BioSemi)

ciara123
Posts: 2
Joined: Mon Sep 16, 2019 5:24 pm

Re: different trigger codes in bdf

Post by ciara123 » Tue Sep 17, 2019 10:40 am

Hi,

Thank you very much for your response.

I am still unsure as to why we have correct trigger codes when I use the decimal settings in ActiView, but then different ones in the .bdf file?

Also, apologies for this, but how exactly do I split the 16 bit trigger word in two 8 bit bytes?



Kind regards,

Ciara

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

Re: different trigger codes in bdf

Post by Coen » Tue Sep 17, 2019 11:35 am

> I am still unsure as to why we have correct trigger codes when I use the decimal settings in ActiView, but then different ones in the .bdf file?

Because for the ActiView display in "decimal" mode, the 16 bit trigger codes (see https://www.biosemi.com/faq/trigger_signals.htm and ) are split into two bytes. The "analog" trigger display mode shows the 16 individual bits.

> Also, apologies for this, but how exactly do I split the 16 bit trigger word in two 8 bit bytes?

Use Google, for example: https://nl.mathworks.com/help/matlab/ref/typecast.html

Best regards, Coen (BioSemi)

lukebbk
Posts: 1
Joined: Tue Sep 17, 2019 11:46 am

Re: different trigger codes in bdf

Post by lukebbk » Tue Sep 17, 2019 11:57 am

Hi Coen,

Collaborator of Ciara here.

First, please do not tell us to Google the solution to this. Ciara's dpt has spent a lot of money on purchasing a BIosemi system and I do not expect to be told to go to Google to get technical details about how to send markers.

As I understand it, you are saying that markers should be sent as 16-bit values (correct me if I'm wrong). My questions are:

1. What is the range of marker values that we can send? Is this limited to 0-255? Does a BDF file support marker values beyond 255?

2. If we wish to send - for example - three markers, of decimal values [1, 100, 255] should they look like this in binary: [0000000000000001, 0000000001100100, 0000000011111111]?

3. When using Matlab's serial implementation (or Psychtoolbox IOPort), what format should we use when writing these values to the port, to ensure that the correct decimal values arrive in Labview and are saved into the BDF.

Thanks,

Luke

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

Re: different trigger codes in bdf

Post by Coen » Tue Sep 17, 2019 2:25 pm

> I do not expect to be told to go to Google to get technical details about how to send markers.

I direct you again to Google on the basic issue of how to split a 16 bit word into two 8 bit bytes during processing of the BDF file. This has nothing to do with sending triggers to the USB-receiver, For technical details about sending triggers I refereed to https://www.biosemi.com/faq/trigger_signals.htm (which basically covers all my additional explanation below)

> As I understand it, you are saying that markers should be sent as 16-bit values (correct me if I'm wrong).

You can sent anything from 1-bit to 16-bit values to the parallel port on the USB receiver.

> 1. What is the range of marker values that we can send? Is this limited to 0-255? Does a BDF file support marker values beyond 255?

Maximum are 16-bit words: 0-65535. However, your can also sent other divisions within the 16 parallel lines (bits), e.g. two parallel 8-bit words (each with 0-255 range).

> 2. If we wish to send - for example - three markers, of decimal values [1, 100, 255] should they look like this in binary: [0000000000000001, 0000000001100100, 0000000011111111]?

Correct.

You can also just sent the least significant 8 bits, and "zero" lines 9-16 (pins 9-16 tied to pin 37, as is already done in the "Presentation cable supplied by BioSemi). If your BDF reader splits the 16 bits in two bytes, then you can ignore the 8 most significant bits all together.

Always inspect what you are actually sending in "analog" trigger display mode (the colored lines and dots).

Regards, Coen (BioSemi)

Post Reply