Hello,
I am using the TDT system to send triggers to Biosemi. I set up the TDT digital port to work with 16 bits, so that should work for biosemi. I also selected all the 16 trigger lines + OR in Biosemi, even though I believe this option really affects only the online average and not what is recorded in the BDF file. The triggers are read and displayed correctly by Biosemi. However, when I try to open the BDF file with the code that I found in EEGLab, the trigger code is off by a factor of 3840, which I believe is caused by Biosemi enabling 4 additional bits. In other words, if I send a trigger code = 4, I should expect to have the following bits: 0000 0000 0000 0100, while in fact I get the following bits: 0000 0111 1000 0000. Well, at least this is the conclusion that I came up with when I tried to recreate 3840 with bits and based on what I read online from other people having trigger offset problems. In the past I used Biosemi with the Presentation software to deliver the triggers and then I opened the bdf files with the same EEGLab function that I am using now and I never had this problem.
Can you please advise if there is anything that I should be changing in the Biosemi configuration file or if you think this is a bug in the matlab code that I am using?
Thank you.
Alex.
Offset in the trigger code read by EEGLab
-
- Site Admin
- Posts: 1148
- Joined: Fri Mar 26, 2004 7:00 pm
- Location: Amsterdam, Netherlands
- Contact:
Re: Offset in the trigger code read by EEGLab
In case of trigger problems, always use the "analog" display mode in ActiView (16 trigger lines displayed separately as colored dots/lines).
The triggers seen in ActiView are definitely the same as the triggers stored in the BDF file, this cannot be affected with any configuration in ActiView. The ActiView software certainly does not shift bits, or create additional bits. The only trigger operations in ActiView are the optional overwrite of triggers 9 and 10 (see viewtopic.php?f=7&t=977), and the overwrite of triggers 9-16 by the function keys F1-F8. However, this does not change the rule that displayed triggers are equal to stored triggers.
Check the triggers in the BDF file with the simple BDF reader: https://www.biosemi.com/download/ToolsF ... er-808.zip
By the way: 3840 = 0000 1111 0000 0000 and 0000 0111 1000 0000 = 1920
Best regards, Coen (BioSemi)
The triggers seen in ActiView are definitely the same as the triggers stored in the BDF file, this cannot be affected with any configuration in ActiView. The ActiView software certainly does not shift bits, or create additional bits. The only trigger operations in ActiView are the optional overwrite of triggers 9 and 10 (see viewtopic.php?f=7&t=977), and the overwrite of triggers 9-16 by the function keys F1-F8. However, this does not change the rule that displayed triggers are equal to stored triggers.
Check the triggers in the BDF file with the simple BDF reader: https://www.biosemi.com/download/ToolsF ... er-808.zip
By the way: 3840 = 0000 1111 0000 0000 and 0000 0111 1000 0000 = 1920
Best regards, Coen (BioSemi)
Re: Offset in the trigger code read by EEGLab
Thank you for your reply. Yes, I made a mistake in the writing the sequence of bits to get 3840, but that is irrelevant to my problem.
I used the BDF reader (I didn't know I was supposed to look at the analog display of the trigger to check for problems, but that is my fault as I should have read the manual more carefully) and opened two bdf files: one that I collected using Presentation to deliver the triggers and one that I collected using TDT system. The bdf file that I recorded using Presentation shows dots of different colors, one for each trigger code sent. These triggers are also read correctly by matlab. The one that I used with TDT displays four additional continuous lines, which I believe are 4 bits held high by TDT. That would explain the offset.
However, the only thing that I don't understand is why Biosemi shows a decimal value of 4 (the one that I am sending) when in fact it should be 3084 based on the trigger lines that are high. This is the only thing that I am confused about and could not find an answer in the manual, but I might have looked in the wrong place.
Thank you again for your help. I appreciate it.
Alex.
I used the BDF reader (I didn't know I was supposed to look at the analog display of the trigger to check for problems, but that is my fault as I should have read the manual more carefully) and opened two bdf files: one that I collected using Presentation to deliver the triggers and one that I collected using TDT system. The bdf file that I recorded using Presentation shows dots of different colors, one for each trigger code sent. These triggers are also read correctly by matlab. The one that I used with TDT displays four additional continuous lines, which I believe are 4 bits held high by TDT. That would explain the offset.
However, the only thing that I don't understand is why Biosemi shows a decimal value of 4 (the one that I am sending) when in fact it should be 3084 based on the trigger lines that are high. This is the only thing that I am confused about and could not find an answer in the manual, but I might have looked in the wrong place.
Thank you again for your help. I appreciate it.
Alex.
Re: Offset in the trigger code read by EEGLab
Sorry, I meant to say "when in fact it should be 3840". Apology for this mistake.
Re: Offset in the trigger code read by EEGLab
One last clarification. When I said that the bit sequence that I wrote had a mistake (thanks for pointing that out) was irrelevant, I just wanted to say that it was a typo on my part, but I understand that having the correct sequence is important to identify the trigger lines that are high in Biosemi. Again, everything is consistent with what I see with the BDF reader (thanks again for the suggestion). I just need to know why the decimal value does not match what I see with the analog trigger.
Thank you.
Thank you.
-
- Site Admin
- Posts: 1148
- Joined: Fri Mar 26, 2004 7:00 pm
- Location: Amsterdam, Netherlands
- Contact:
Re: Offset in the trigger code read by EEGLab
For non-analog display modes, the triggers are split in two groups of 8 lines (bits):
0000 0000 0000 0100 (4) shows a 4 in the upper half of the trigger display
0000 0100 0000 0000 (1024) shows a 4 in the lower half of the trigger display
Best regards, Coen (BioSemi)
0000 0000 0000 0100 (4) shows a 4 in the upper half of the trigger display
0000 0100 0000 0000 (1024) shows a 4 in the lower half of the trigger display
Best regards, Coen (BioSemi)
Re: Offset in the trigger code read by EEGLab
Understood.
Thank you for your help and your time. I appreciate it.
Alex.
Thank you for your help and your time. I appreciate it.
Alex.