Physiological recording systems

From REALab Wiki
Jump to navigation Jump to search

<<The Basics of Thought Technology’s Physiological Monitoring System>> by. Michelle Jarick (May 23rd, 2012)


The Encoders and sensors & How to attach the sensors

{{#ev:youtube|9aF8wcf8kIo|500|Here is a description of the video}}

The Encoders (we have two, but you can encode two people at the same time using only one, as long as you only use 4 sensor or less per person ) - Turn the power on - Fiber optic connection - Sensor connections (max. input of 8 sensors) The sensors (different types of sensors) - Skin conductance - Blood volume Pulse (to measure the heart rate) - Respiration (to measure the breathing rate) - EKG (Electrocardiogram, more accurate BUT need to touch the person’s chest; could be more invasive so that people don’t like it) - Temperature Attaching the Sensors to People - Blood Volume Pulse (BVP) - Skin Conductance - Respiration sensor

Recording with Physiology Suit - Part 1 & 2

Part 1

{{#ev:youtube|RnbaLgcHbnw|500|Here is a description of the video}}

Part 2

{{#ev:youtube|ziaSZnznyYU|500|Here is a description of the video}}


Recording with Physiology Suit (Demonstration Time) - BIOGRAPH IFINITI - Demonstration time - To get the date out…..physiological/virtual channel


Skin conductance

{{#ev:youtube|xpTD90_2R40|500|Here is a description of the video}}

What is skin conductance? Why measure skin conductance? What does skin conductance look like? Skin conductance measures - Skin conductance response (SCR) - Skin conductance level (SCL) Pre-processing of SCRs and SCLs Skin conductance measures Two ways to analyze SCRs - Magnitude - Amplitude


Heart Rate

{{#ev:youtube|xDlBg7z094E|500|Here is a description of the video}}

What is Heart Rate? Two ways to analyze Heart Rate Heart Rate is a course measure Artifact - FREE! Examples


Matlab code

To connect the physio laptop with another computer running a psychtoolbox experiment via matlab, use the following code on the display computer (I think both computers must have internet connection for matlab to run and in addition have an ethernet connection for this communication):

%send keyPress setup/variables
hostname = '142.103.0.243';
sock=pnet('udpsocket', 9090);
pnet(sock, 'udpconnect', hostname, 9091);

%send event marker for start of trial
pnet(sock, 'printf', 's'); % will mark event A, change 'a' to 'b' to mark event B, for any event B, C, D, etc.
pnet(sock, 'writepacket');

%quit event marking
pnet(sock, 'printf', 'quit'); % will mark event A, change 'a' to 'b' to mark event B, for any event B, C, D, etc.
pnet(sock, 'writepacket');

Use the following code on the physio laptop to receive commands from the display computer, and trigger key presses:

sock=pnet('udpsocket',9091);
pnet(sock,'setreadtimeout',0.1);
h = actxserver('WScript.Shell');
disp 'working...'
run = 'yes';
h.AppActivate('Infiniti Software System');

while(strcmp(run,'yes'))
    
    [~,~,keyCode] = KbCheck;
    if find(keyCode) == 27
        run = 'quit';
        disp 'quit'
    end
    
    size=pnet(sock,'readpacket');
    if(size > 0)
        
       data = pnet(sock,'read');
       if(strcmp(data,'quit'))
          
           run = data;
           
       else
           h.AppActivate('Infiniti Software System');
           keyPress = strcat('^',data);
           h.SendKeys(keyPress);
       end
        
    end
    
    
end

disp 'job done!'
pnet('closeall')


TCP-IP Matlab Code

If the code above doesn't work for you, you can use direct tcp-ip network communication via the following matlab code (one script runs from the computer where you're presenting the stimuli, the other runs from the physio laptop):

Display computer code

You can send particular letters to the physiological laptop's software via matlab to mark events, but note that certain letters have special meanings so be sure to check the physio output before proceeding.

%Beginning of script:
%command out the physiological software
phys = 'on';

if strcmp(phys, 'on')
    % set up host and receiver ports for transfering data
    ipA='150.100.100.20'; portA=9091;
    ipB='150.100.100.21'; portB=9090;
    udpA=udp(ipB, portB, 'LocalPort', portA, 'InputBufferSize', 8);
    udpA.terminator='LF/CR';
    fopen(udpA)
end

%%%%%%%%%%%%%%%%%%%%%

%After showing instructions:
if strcmp(phys, 'on')
    fprintf(udpA, 'i');
end

%%%%%%%%%%%%%%%%%%%%%

%After presenting a specific stimulus:
      if stim ==3
          if strcmp(phys, 'on')
            fprintf(udpA,'d')
          end
      else
           if strcmp(phys, 'on')
             fprintf(udpA,'o')
           end
      end

%%%%%%%%%%%%%%%%%%%%%%

%After subject presses right key:
                if strcmp(phys, 'on')
                    fprintf(udpA, 'r');
                end

%%%%%%%%%%%%%%%%%%%%%%

%At the end of your script:

%quit event marking
if strcmp(phys, 'on')
    fprintf(udpA,'q')
    fclose(udpA);
end

Here is a script from one of Miriam Maan's experiment's which marks events on the physio software using a matlab script that's running on the eyelink computer: UBC_SART_MM_310315.m


Physio laptop code

This matlab code runs on the physio laptop. It receives tcp-ip communications over an ethernet cable from the computer that's running your experiment, then stamps the codes it receives onto the bio semi software while it's recording physiological data (basically the code stamps events by simulating a key press). Make sure you adjust the tcp-ip settings on both computers to match those specified in the script. Run the physio matlab script first, then run the display computer's matlab script. Note that when the letter 'q' is sent by the display code, the physio laptop code will quit checking for event codes from the display computer, and the script will end.

Miriam_remote_pressKey.m