Weird GSR data

Post Reply
happilylazy
Posts: 20
Joined: Mon Jun 21, 2010 3:27 pm
Location: Karlskrona

Weird GSR data

Post by happilylazy »

I have a BioSemi Active Two Mk2 box (checked against serial key) and 16 Hz excitation current (check by GSR unit displayed in ActiView).
I together with a colegue we wrote an acquisition program for GSR values. Can you help me decipher what is going on with my values from the ringbuffer please.

The most natural looking value in the ringbuffer is e.g. 48439296.
That makes it in binary 10111000110010000000000000. After dividing 48439296 by 256 to get rid of the additionally inserted zero LSB; we have 189216, that is, 101110001100100000.

So my 24 bit Integer is 189216.I found in one thread that this value is stored in the ringbuffer as scaled nanoSiemens with a factor of 31.25 nS, so that makes it 189216 * 31.25 or 5913000 nS

To sum it all up
32bit Integer: 48439296
24bit Integer: 189216
GSR value: 5913000 nS = 5913 uS

Please correct me if I’m wrong up until now.

Back to the question, why do the values jump between positive and negative values?
Here’s an exempt from the value list:

Sync: -256 gv: 4666uS
Sync: -256 gv: 4937uS
Sync: -256 gv: 5358uS
Sync: -256 gv: 5612uS
Sync: -256 gv: 5600uS
Sync: -256 gv: 5533uS
Sync: -256 gv: 5653uS
Sync: -256 gv: 5997uS
Sync: -256 gv: 6127uS
Sync: -256 gv: 6036uS
Sync: -256 gv: 5913uS
Sync: -256 gv: 6001uS
Sync: -256 gv: 6282uS
Sync: -256 gv: 6374uS
Sync: -256 gv: 6245uS
Sync: -256 gv: 6098uS
Sync: -256 gv: 3200uS <- this is where data get's corrupted
Sync: -256 gv: 963uS
Sync: -256 gv: -16uS
Sync: -256 gv: -829uS
Sync: -256 gv: -1461uS
Sync: -256 gv: -1758uS
Sync: -256 gv: -1796uS
Sync: -256 gv: -1955uS
Sync: -256 gv: -2288uS
Sync: -256 gv: -2599uS
Sync: -256 gv: -2676uS
Sync: -256 gv: -2530uS
Sync: -256 gv: -2578uS
Sync: -256 gv: -2843uS
Sync: -256 gv: -3074uS
Sync: -256 gv: -3080uS
Sync: -256 gv: -2889uS
Sync: -256 gv: -2884uS
Sync: -256 gv: -3104uS
Sync: -256 gv: -3295uS
Sync: -256 gv: -3267uS
Sync: -256 gv: -1855uS
Sync: -256 gv: 1874uS
Sync: -256 gv: 2988uS
Sync: -256 gv: 3572uS
Sync: -256 gv: 4157uS
Sync: -256 gv: 4774uS
Sync: -256 gv: 5097uS <- this is where we get back to the normal values
Sync: -256 gv: 5144uS
Sync: -256 gv: 5174uS
Sync: -256 gv: 5397uS
Sync: -256 gv: 5763uS
Sync: -256 gv: 5902uS
Sync: -256 gv: 5795uS

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

Post by Coen »

The scaling of LSB = 31.25 nS is valid for the 24-bit words in the BDF files. The ADC output words of the electrode channels are directly streamed to file without further processing. However, the data for some sensor channels (GSR, ERGO, RESP, TEMP) coming in via the USB port is further processed in ActiView before streamed to screen and file. In case of the GSR, the conductance values are extracted from the incoming ADC values indicating the measured voltage drop of the 16 Hz excitation signal across the GSR electrodes. Please refer to the ActiView source code for more details about calculating GSR values from the incoming data.

Best regards, Coen (BioSemi)

happilylazy
Posts: 20
Joined: Mon Jun 21, 2010 3:27 pm
Location: Karlskrona

Post by happilylazy »

Can you please direct me on how to see the "ActiView source code". I have "ActiView605-Laptop.vi" but how do you read the actual source code from this?

Or if you or someone who has the code, can post the code snippet regarding calculation of GSR values.

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

Post by Coen »

Install LabVIEW 8.2 or higher on your PC, open ActiView605-Laptop.vi, select the "About ActiView" tabpage and left-click on the red center square to stop the VI from running, press CTRL+E to see the diagram (source code), open subvi Convert_4-8.vi and press CTRL+E, open subvi GSR16.vi and press CTRL+E.

Best regards, Coen (BioSemi)

happilylazy
Posts: 20
Joined: Mon Jun 21, 2010 3:27 pm
Location: Karlskrona

Re: Weird GSR data

Post by happilylazy »

Can you please help us in decoding the .vi GSR object to get the real GSR value in correct voltage measure. I'm afraid we are a bit unexperianced with LabView, but we can write regular code.
Picture is related. Its GSR object from LabView

What we have are the values pasted in the above post, and we need them corrected in the correct voltage measure using the same ActiView GSR16.vi module that corrects for these values (posted in the picture).

//Petar
Attachments
sourcecode.png
sourcecode.png (152.38 KiB) Viewed 16408 times

happilylazy
Posts: 20
Joined: Mon Jun 21, 2010 3:27 pm
Location: Karlskrona

Re: Weird GSR data

Post by happilylazy »

So since we can get a new GSR data every half-wave of 16 Hz excitation current, that means the sampling rate is 32 Hz.

Then from the values posted above:

Sync: -256 gv: 4666uS
Sync: -256 gv: 4937uS
Sync: -256 gv: 5358uS
Sync: -256 gv: 5612uS
Sync: -256 gv: 5600uS
Sync: -256 gv: 5533uS
Sync: -256 gv: 5653uS
Sync: -256 gv: 5997uS
Sync: -256 gv: 6127uS
Sync: -256 gv: 6036uS
Sync: -256 gv: 5913uS
Sync: -256 gv: 6001uS
Sync: -256 gv: 6282uS
Sync: -256 gv: 6374uS
Sync: -256 gv: 6245uS
Sync: -256 gv: 6098uS
Sync: -256 gv: 3200uS
Sync: -256 gv: 963uS
Sync: -256 gv: -16uS
Sync: -256 gv: -829uS
Sync: -256 gv: -1461uS
Sync: -256 gv: -1758uS
Sync: -256 gv: -1796uS
Sync: -256 gv: -1955uS
Sync: -256 gv: -2288uS
Sync: -256 gv: -2599uS
Sync: -256 gv: -2676uS
Sync: -256 gv: -2530uS
Sync: -256 gv: -2578uS
Sync: -256 gv: -2843uS
Sync: -256 gv: -3074uS
Sync: -256 gv: -3080uS
Sync: -256 gv: -2889uS
Sync: -256 gv: -2884uS
Sync: -256 gv: -3104uS
Sync: -256 gv: -3295uS
Sync: -256 gv: -3267uS
Sync: -256 gv: -1855uS
Sync: -256 gv: 1874uS
Sync: -256 gv: 2988uS
Sync: -256 gv: 3572uS
Sync: -256 gv: 4157uS
Sync: -256 gv: 4774uS
Sync: -256 gv: 5097uS
Sync: -256 gv: 5144uS
Sync: -256 gv: 5174uS
Sync: -256 gv: 5397uS
Sync: -256 gv: 5763uS
Sync: -256 gv: 5902uS
Sync: -256 gv: 5795uS

This small sample has then three values usable, those are 6036uS, -3080uS and 5174uS (chosen at random).
My questions are:

Why are the positive and negative values so different? Since they both are sampled very close timeframe, one would expect same value, but negative sign.

Why is the value fluctuating between samples? Since, i quote "This means that a new GSR value can only appear every half-wave, or every 31.25 ms", wouldn't the value stay the same across the half-wave?

happilylazy
Posts: 20
Joined: Mon Jun 21, 2010 3:27 pm
Location: Karlskrona

Re: Weird GSR data

Post by happilylazy »

Can you please answer the previous post question, which boils down to: Which value(s) to regard as a current GSR value, during the 16Hz excitation current half-wave?

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

Re: Weird GSR data

Post by Coen »

My LabVIEW code explains it better than words, Coen (BioSemi)

Post Reply