No Slide Title by bwIjXO


									 Control of (some) External
Devices using MatLab/Cogent

      Steffan Kennett,
                         Topics covered
Parallel Ports (see Stimuluscheck.m):
        Set-up procedure
        Implementation in code
        Problems (addresses, timing)

Eye-tracking (see Eyetracker_demo.m):
        Acquiring data.
        Meaning from data (calibration)

Vocal Reaction Time (see voiceRT.m):
        Acquiring data
        Calculating reaction time
                       Parallel Ports
• Digital Signal
• Up to 8 lines independently controlled
• Use signal to switch on stimuli (lights, taps, TMS etc.)
    – This requires some form of switch box to transfer signal and
      power to the external stimuli (e.g., LEDs or tappers)
• Use signal to trigger EEG, fMRI, TMS.
    – Requires the parallel port cable is appropriately wired for your
      specific device

 Excellent documentation at point 3.12 of cogmanv125.pdf
 Extract follow instructions.
 Use function “outportb(port_address,value)”. See Stimuluscheck.m
                  Parallel Ports
Address: usually 888, could be 632, 956. Refers to specific
 parallel port.
Value: any integer from 1 to 255
Value is actually the decimal version of an 8-bit binary
 number (1 1 1 1 1 1 1 = 255).
          Line         Binary value   Decimal value
          1            00000001       1
          2            00000010       2
          3            00000100       4
          4            00001000       8
          5            00010000       16
          6            00100000       32
          7            01000000       64
          8            10000000       128

  Lines 3 and 5 would be value = 4 + 16 = 20
• Cogent only supports the ASL 5-series (e.g., ASL 5000), which is the
  eye-tracker currently installed in the MRI scanners at 12, Queen
• Good documentation is in G2UsrManv124.pdf. See pages D10, E5,
  F21 and section I.
• See also sample m-file Tracker.m (Samples folder) and
  Eyetracker_demo.m (Matlab course download)

Calibration tip:
Once you’ve set-up the eye-tracker you will have to carry out the tracker-
 software’s own calibration procedure.
Even having done this, start each experiment, or better, each block of
 trials with a mini-calibration of your own. Use jumping crosses of known
 visual angle (see . Choose these visual angles to be relevent to your
 experiment (e.g., close to fixation point if you do not want saccades in
 your experiment). See jumping_cross.m.
              Vocal Reaction Time
• Uses built-in microphone or one plugged into the sound card of
  your PC.
• Employs “config_sound” prior to “start_cogent”
• Commands used (input/output variables in italics):
    – preparerecording(duration_in_ms)
    – recordsound
    – waitrecord
    – sound_vector = getrecording

• See voiceRT.m for a fully commented, working script
    – RT is calculated by measuring the first sample which exceeds a
      threshold level (user sets this) and working out the time since the
      stimulus was presented.

To top