Note: This manual is a work in progress!
Overview
This GUI generates the parameters for variables defined in the RPvds circuit. Display this GUI by typing >> ep_ExperimentDesign
in the Matlab command window.
This GUI allows you to define how RPvds parameters (such as frequency, amplitude, duration, etc.) are updated on a 'trial-by-trial' basis.
In a behavior experiment (with or without electrophysiology; ep_RunExpt
), we define 'trial' as a single measurement of the subjects response to some stimulus .
In an electrophysiology experiment (typically anaesthetised or passive recordings; ep_EPhys
), we define 'trial' as a single presentation of some stimulus.
The basic strategy for generating the experiment using this GUI is to:
The first step in designing an experiment is to determine which TDT hardware modules will be running circuits that need to be updated on a trial-by-trial basis.
This hardware may be an RX6 module if high-frequency sampling rates are required to produce ultrasonic sounds, or an RX8 module if an array of speakers are required for a sound localization experiment, etc.
RPvds circuits should be created first and designed to meet the specific needs of the experiment.
Once the RPvds circuits are created (they can be modified and refined later), add all modules to the ep_ExpeirmentMaker
GUI by clicking the + sign.
If making a new experiment design, a prompt will appear asking whether the TDT OpenEx software.
Typically, the OpenEx software is used in conjunction with electrophysiology experiments, with or without behavior.
OpenEx can be used with behavior alone, however, this tends to increase the complexity and time spent on setup.
Next, a prompt will appear requesting an alias (a name) for the hardware module.
If using OpenEx the module alias needs to be the same as the name used in the OpenWorkbench; otherwise, the alias is aribtrary, but required.
Each row of the parameter table identifies the parameter tags that you would like updated in the RPvds circuit file on a 'trial-by-trial' basis. The 'Tag' column of the parameter table is the name of the parameter tags within the circuit. This field is case sensitive and should not contain any spaces. A find-and-replace search function is included in the menu: Protocol > FindReplace (ctrl+F) All tags named here should be located within the circuit (with the exception of the asterisk prefix flag discussed below).
*ParameterName
.
The software will ignore any parameter tags starting with an asterisk and will not attempt to update them before each trial begins.
You can still update parameters beginning with an askerisk in your custom functions if you need to.
The parameter function column defines how EPsych should interact with the parameters on a trial-by-trial basis. There are three options for this field: read, write, read/write
The Values column in the parameter table defines what numerical values will be passed for each parameter during an experiment before each trial.
If you enter something in this field, then you will use the write or read/write parameter function.
If you leave this field empty, then you must select the read function.
The Values field will accept one or more numerical values, such as 123
for a scalar value or [1, 2, 3]
for an array.
In practice, you may enter any Matlab command that returns a scalar value or a 1xN numerical array.
This allows you to use syntax like:
1:5
evaluates to [1, 2, 3, 4, 5]
1:3:9
evaluates to [1, 3, 9]
logspace(1,3,5)
evaluates to [10.0000, 17.7828, 31.6228, 56.2341, 100.0000]
rand(1,5)
evaluates to [0.0855, 0.2625, 0.8010, 0.0292, 0.9289]
, or 5 values chosen randomly from a uniform distribution5+rand(1,5)
evaluates to [5.0855, 5.2625, 5.8010, 5.0292, 5.9289]
MyFavoriteFunction(1234)
evaluates to whatever you would like, as long as it returns a 1xN numerical array
It is often useful to tie the values of two or more parameters together. This feature is especially useful when running experiments using multiple hardware modules. The values of parameters can be tied together by clicking the dropdown box and selecting < ADD >. Enter a meaningful name in the input box and click OK. The name is arbitrary, but should be something meaningful to you. This will create a new item with the entered name in all Buddy drop down boxes. Select this new Buddy for additional parameters on the same module or across modules. The values of buddied-up parameters will be tied together so that the first number in all buddied parameters will be locked together; the second number in all budied parameters will be locked, etc. You can create as many Buddy parameters as needed.
ep_Ephys
.
The ITI value (below) is ignored if this option is checked.
ep_EPsych
for passive recordings, the software does its best to trigger the next trial on time, Windows is not deterministic and this timing can not be guaranteed.
While the ITI can vary to some degree (on the order of milliseconds), the actual trigger timestamp is recorded by the real-time TDT hardware and is highly accurate and precise.
There are a few workarounds if you require highly accurate triggering.
One strategy is to use the Operational Trigger option and macro (see above) triggerd by a PulseTrain component in the RPvds circuit.
This is not an issue when running operant conditioning behavioral experiments using ep_RunExpt
because the trial is initiated by the subject and not the Matlab software.
One of the more powerful uses of the EPsych software is the ability to write your own code to custoize how the experiment functions.
While this is optional, more complex paradigms which utilize external software (such as the Psychtoolbox) or which adjust the next stimulus based on behavioral or neural responses can be accomplished by writing a custom function.
This custom trial selection function must take one input, a structure with the trial parameters and other information, and one output, either the next trial index (see below) or the entire structure (modified or not) that was received as an input to this function.
The two prototypes for this function would be:
NextTrialID = MyCustomFunction(TRIALS)
TRIALS = MyCustomFunction(TRIALS)