Accessing GSR data using C code
Posted: Tue Feb 18, 2014 12:05 am
Hi, I am having trouble storing GSR data when it is directly accessed using some C code, but no trouble storing the EEG data, and no trouble with the external data (EX1-EX8).
There is more detail below, but my core questions are:
1) Is the GSR data treated differently than the external analog channels?
2) If so, how is the raw GSR data converted to the final GSR/skin conductance signal?
Some elaboration:
We are using an Active Two system, running on a Macbook (ActiveVew 700-Mac). It is setup so it can record GSR with a 16hz coupler (the units in ActiveView are nanoSiemens). When we record the data using ActiveView, the GSR data stored in the BDF file seems fine (loaded using EEGlab in matlab).
However, I am having trouble getting the GSR data in our real-time setup. Our real-time setup uses Fieldtrip to stream the data, and we record data into a GDF file (rather than a BDF). Fieldtrip provides a set of c++ files that we used for the data streaming and real-time storage. This code accesses the USB driver and then relays the Activew data both to a TCP/IP server, and also stores the data in a GDF file. The real-time code works fine when just accessing EEG data, and it also works fine when we add the 8 external channels (channel numbers 257-264) on top of the EEG data.
The problem arises when we go beyond the 8 External channels. In the real-time code when I record channels 265-272 (the auxiliary channels, of which 265 is the GSR channel I really want to record), the GSR data does not seem to be accessed/stored properly. Instead of the GSR data, instead on channels 265&266 we get what appears to be the 16Hz excitation signal (the two channels appear to be 180 degrees out of phase with each other). Similarly on channels 267&268 we get what looks to be a low-pass filtered square wave, also ~16hz (also ~180 degrees out of phase). We currently don’t have a system with the strain gauges (Erg1&2) hooked up (which is what should be on channels 267&268), but I was trying to record all the external and auxiliary channels to see if the data was just miss-numbered and saw the second set of 16hz signals.
Looking at post: www.biosemi.nl/forum/viewtopic.php?f=7&t=607 it sounds like GSR data undergoes additional processing within the ActiveView Client before storage in the BDF file. Is this the case? And am I thus correct in understanding that without replicating those operations, the ‘raw’ GSR data arriving from the Actiview would simply appear as a sine’ish wave? I would like to know if this is so, because it would confirm that we are accessing the raw data correctly but we need to replicate the ActiveView operations for the raw data to be useful.
If so, does channel 265 still correspond to the first (of the two optional) GSR sensors? Or is there more than one channel of ‘raw’ GSR data that corresponds to a single GSR sensor (eg 265&266), and which are both combined in some fashion to derive the final GSR signal? I am, unfortunately, not a Labview programmer, although I am proficient at C and am extremely good at matlab, so I was just wondering if anyone had a summary of the operations that Actiview does to the channel(s) of raw GSR data so I could then replicate that in our C code.
Any pointers would be appreciated.
Thanks!
Eric
There is more detail below, but my core questions are:
1) Is the GSR data treated differently than the external analog channels?
2) If so, how is the raw GSR data converted to the final GSR/skin conductance signal?
Some elaboration:
We are using an Active Two system, running on a Macbook (ActiveVew 700-Mac). It is setup so it can record GSR with a 16hz coupler (the units in ActiveView are nanoSiemens). When we record the data using ActiveView, the GSR data stored in the BDF file seems fine (loaded using EEGlab in matlab).
However, I am having trouble getting the GSR data in our real-time setup. Our real-time setup uses Fieldtrip to stream the data, and we record data into a GDF file (rather than a BDF). Fieldtrip provides a set of c++ files that we used for the data streaming and real-time storage. This code accesses the USB driver and then relays the Activew data both to a TCP/IP server, and also stores the data in a GDF file. The real-time code works fine when just accessing EEG data, and it also works fine when we add the 8 external channels (channel numbers 257-264) on top of the EEG data.
The problem arises when we go beyond the 8 External channels. In the real-time code when I record channels 265-272 (the auxiliary channels, of which 265 is the GSR channel I really want to record), the GSR data does not seem to be accessed/stored properly. Instead of the GSR data, instead on channels 265&266 we get what appears to be the 16Hz excitation signal (the two channels appear to be 180 degrees out of phase with each other). Similarly on channels 267&268 we get what looks to be a low-pass filtered square wave, also ~16hz (also ~180 degrees out of phase). We currently don’t have a system with the strain gauges (Erg1&2) hooked up (which is what should be on channels 267&268), but I was trying to record all the external and auxiliary channels to see if the data was just miss-numbered and saw the second set of 16hz signals.
Looking at post: www.biosemi.nl/forum/viewtopic.php?f=7&t=607 it sounds like GSR data undergoes additional processing within the ActiveView Client before storage in the BDF file. Is this the case? And am I thus correct in understanding that without replicating those operations, the ‘raw’ GSR data arriving from the Actiview would simply appear as a sine’ish wave? I would like to know if this is so, because it would confirm that we are accessing the raw data correctly but we need to replicate the ActiveView operations for the raw data to be useful.
If so, does channel 265 still correspond to the first (of the two optional) GSR sensors? Or is there more than one channel of ‘raw’ GSR data that corresponds to a single GSR sensor (eg 265&266), and which are both combined in some fashion to derive the final GSR signal? I am, unfortunately, not a Labview programmer, although I am proficient at C and am extremely good at matlab, so I was just wondering if anyone had a summary of the operations that Actiview does to the channel(s) of raw GSR data so I could then replicate that in our C code.
Any pointers would be appreciated.
Thanks!
Eric