Return to the Duration Discrimination Task page
						
									    DURATION DISCRIMINATION
SCRIPT INFO

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 06-11-2013
last updated: 08-15-2016 by K.Borchert (katjab@millisecond.com) for Millisecond Software LLC

Copyright © 08-15-2016 Millisecond Software


BACKGROUND INFO

											*Purpose*
This script implements a Duration Discrimination procedure similarly to the one described in:

Wittmann, M., Leland, D.S., Jan Churan, J. & Paulus, M.P.(2007). Impaired time perception and motor timing
in stimulant-dependent subjects. Drug and Alcohol Dependence, 90, 183–192.

											  *Task*
Participants listen to two tones (one a standard tone, the other the comparison tone) one after the other and have to decide 
which is longer. In half the trials the standard is played first.
Two different standard tone lengths are used: 100ms (short) vs. 1000ms (long).
Within 50 trials (default; change under BLOCKS -> block.durationdiscrimination) the script attempts to estimate
the participants' threshold durations via an Accelerated Stochastic Approximation procedure 
(see below for an explanation).


DATA FILE INFORMATION: 
The default data stored in the data files are:

(1) Raw data file: 'DurationDiscrimination_raw*.iqdat' (a separate file for each participant)

build:								Inquisit build
computer.platform:					the platform the script was run on
date, time, subject, group:			date and time script was run with the current subject/groupnumber 
blockcode, blocknum:				the name and number of the current block
trialcode, trialnum: 				the name and number of the currently recorded trial
										(Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) 
/condition:							1 = standard 1 trial sequence; 2 = standard 2 trial sequence
/currtrialcount_standard1_n:		counts the trials in standard 1 trial sequence
/currtrialcount_standard2_n:		counts the trials in standard 2 trial sequence
/comptone_duration:					stores the currently valid (depending on standard) current duration of the comparison tone in data file
/stepsize:							stores the currently valid stepsize (depending on standard) in the data file
/nextcomptone_duration:				stores the currently valid (depending on standard) next duration of the comparison tone in data file
/curr_response-	
/last_response:						store the values for the current and the previous response accurracy for the currently tested tone condition
response:							the participant's response (scancode of response)
										2 => participant pressed '1'
										3 => participant pressed '2'
correct:							the correctness of the response (1 = correct; 0 = incorrect)
latency: 							the response latency (in ms)

(2) Summary data file: 'DurationDiscrimination_summary*.iqdat' (a separate file for each participant)

script.startdate:					date script was run
script.starttime:					time script was started
script.subjectid:					subject id number
script.groupid:						group id number
script.elapsedtime:					time it took to run script (in ms)
computer.platform:					the platform the script was run on
/completed:							0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run)
/probability_p:						target threshold probability (default: 0.75)
/number_iterations: 				stores the number of trials used to determine threshold
/standard1_duration:				duration of standard 1 tone in ms (default: 100ms)
/standard2_duration:				duration of standard 2 tone in ms (default: 1000ms)
/initialduration_comp1:				initial duration for comparison 1 tone in ms (default: 300ms)
/initialduration_comp2:				initial duration for comparison 2 tone in ms (default: 3000ms)
/initialcorrection_standard1_C:		initial stepsize correction for standard 1 tone in ms (default: 100ms)
/initialcorrection_standard2_C:		initial stepsize correction for standard 2 tone in ms (default: 1000ms)
/threshold1_duration: 				the threshold duration for standard tone1 in ms (determined as values.nextcomptone1_duration)
/threshold2_duration:  				the threshold duration for standard tone2 in ms (determined as values.nextcomptone2_duration)

EXPERIMENTAL SET-UP

Threshold Estimation
The Duration Discrimination procedure described (Wittman et al, 2007) used the adaptive maximum-likelihood based 
algorithm  YAAP (Treutwein, 1997)* to vary the length of the next stimulus in order to find the participant's threshold
duration (threshold duration was defined as the duration at which a participant makes correct choice with probability p = 0.75).
Based on Dr. Treutwein's own recommendation, this script uses the Accelerated Stochastic Approximation Procedure (ASA)
(e.g. Faes et al, 2007)** instead.

Millisecond Software thanks Dr. Treutwein for his generous assistance!

*Treutwein, B. (1997). YAAP: yet another adaptive procedure. Spatial Vision 11, 129–134.

**Faes, L., Ricci, L., Vescovi, M., Turatto, M., Pavani, F., & Antolini, R. (2007). Small-sample characterization of stochastic
approximation staircases in forced-choice adaptive threshold estimation. Perception & Psychophysics, 69 (2), 254-262.

Accelerated Stochastic Approximation (ASA) Procedure:
Stochastic Approximation Procedures (SA) belong to the category of non-parametric adaptive procedures to establish 
sensory thresholds. Their goal is to determine the threshold intensity at which point participants make the correct choice 
with probability p.

SAs are staircase procedures with variable steps that adjust the next stimulus intensity  (either up=increase or down=decrease stimulus intensity) 
depending on whether response was correct or incorrect over the course of a set number of trials (N). 
The adjustment of the stimulus intensity is inverse to the number of trials run, so adjustments get smaller the more trials have been run.  

stepsizecorrection_decrease = C * (1-p)/n   (after correct response, n = number of trials run so far, C= initial step size correction)
stepsizecorrect_increase = (C*p) / n        (after incorrect response, n = number of trials run so far, C= initial step size correction)

ASAs differ from the more basic SAs simply by not adjusting the step size after each response but only if a shift in the response (from correct to 
incorrect or vice versa) occurs. In ASA procedures the stimulus intensities tested home in on the threshold intensity more rapidly
compared to the standard SA procedures.

According to Faes et al (2007), ASA work relatively well for 2-alternative forced-choice paradigms as long as
1. the initial stimulus intensity is above the participant's threshold
2. the procedure is started with a relatively large initial step size correction (C)

Furthermore, there will be a trade-off for ASA procedures between determining accurate thresholds (the more 
trials are run the more accurate the threshold) and the length of the assessment (the more trials
are run the longer the experiment). The threshold itself can be estimated using two alternative ways:
1. the threshold is the duration that would have been chosen next had the procedure not terminated (used in this 
script)
2. the average of the last M trials

In this script: 50 trials per standard tone (=> 100 trials total)

INSTRUCTIONS
instructions are not original and can be easily edited under section Editable Instructions

EDITABLE CODE:
check below for (relatively) easily editable parameters, stimuli, instructions etc. 
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment.

The parameters you can change are:

/standard1_duration:							duration of standard 1 tone in ms (default: 100ms)
/standard2_duration:							duration of standard 2 tone in ms (default: 1000ms)
/initialduration_comp1:							initial duration for comparison 1 tone in ms (default: 300ms)
/initialduration_comp2:							initial duration for comparison 2 tone in ms (default: 3000ms)
/comp1_min:										minimum duration of comparison 1 tone in ms (default: 101ms)
/comp2_min:										minimum duration of comparison 2 tone in ms (default: 1005ms)

/initialcorrection_standard1_C:					initial stepsize correction for standard 1 tone in ms (default: 100ms)
/initialcorrection_standard2_C:					initial stepsize correction for standard 2 tone in ms (default: 1000ms)

/probability_p:									target threshold probability (default: 0.75)

/InterstimulusInterval:							pause between the two tones in ms (default: 500ms)
/Intertrialinterval:							pause between trial sequences in ms (default: 1000ms)

Copyright © Millisecond Software. All rights reserved.
Contact | Terms of Service | Security Statement | Employment