STAIRCASE: a classic MATLAB toolbox for auditory testing

STAIRCASE is a MATLAB toolbox for auditory testing. The toolbox implements the three main variants of the staircase family, namely, the method of limits (Fechner, 1889), the simple up-down (von BÚkÚsy, 1947; Dixon & Mood, 1948) and the transformed up-down (Wetherill & Levitt, 1965; Levitt, 1971). The toolbox comes with more than twenty built-in experiments that can be run with any of the three procedures. For each experiment, the parameters of the staircase can be set through a graphical interface. The toolbox comes with several signal generators and modifiers, and does not require any programming skill. STAIRCASE extends the previous toolbox (i.e., MLP) developed by Grassi and Soranzo (2009).

Download, install and run install STAIRCASE

Click here to download the toolbox. Unzip the file and move the "PSYCHOACOUSTICS" folder into the MATLAB toolbox folder. Note that the STAIRCASE toolbox is distributed together with the MLP toolbox. Please, do not install the toolbox in a different folder. Now you need to include the toolbox in the MATLAB path. Relaunch MATLAB and at the MATLAB prompt type "Staircase". (Note that the latest versions of MATLAB are case sensitive.) You can now select the experiment that you want to run. Please, read the experiment description at the top of the graphical interface to understand the characteristics of the experiment and the parameter that will be varied adaptively during the procedure you have chosen. Fill in the missing information (e.g., subject's name, sex and so on), adapt the procedure parameters to your own needs, save the parameters (if you want to) and press "START".

How to to respond

In all built-in experiment the subject responds by pressing the key-numbers of the computer keyboard. In nI-nAFC experiments the subject reports the temporal position of the variable stimulus. For example, in a 4AFC task, if the subject thinks that the variable stimulus was the third stimulus presented s/he has to press "3". In yes/no task (when available), the "1" number corresponds to the answer "yes, I perceived/detect" and any other number (e.g, "0") corresponds to the "no, I don't perceive/detect" answer. Key pressures must be followed by the "return" key.

The datafile

At the end of the experiment, each procedure saves two data files (tab-delimited, flat format, text files) in the MATLAB current directory. The first is an extended data file that contains all experiment's events: i.e., subject number, name, sex, age and note, block number, trial number, level of the stimulus and so on. The name of this file can be set by the user through the graphical interface. The second data file contains only the subject's threshold and it is saved after each subject. By default, the name of this file is the subject's name. If the user do not input the subject's name the file is called "untitled.txt".

Toolbox's description

The built-in experiments

The majority of built-in experiments are classic psychoacoustics experiment. Some are adapted from a set of experiments performed by Kidd, Watson and Gygi (2007). These authors run nine-teen classic psychoacoustics experiments on a large (N=340) number of adult subjects. The PSYCHOACOUSTICS user running these experiments can thus compare his/hers own results with those reported in that study. (Readers interested in an identical replicate of the experiments run by Kidd, Watson, and Gygi should refer to the Test of Basic Auditory Capabilities by the same authors, Communication Disorders Technologies Inc.) All built-in experiments come with default parameters. The user can, however, change parameters at will. If changes are made and saved they will be kept until the next "SAVE DEFAULTS" command will be called. When the user presses "START" the experiment begins and the stimuli are presented to the subject.
Click here to see some of the available experiments.

How to change the experiment parameters

In the case the specifics of the built-in experiments do not match the experimenter's needs s/he can edit them and adapt them to his/hers own needs. The characteristics of the sounds of each experiments are written at the beginning of the experiment.m files and can be easily changed. More advanced MATLAB users can write their own experiments by take as example any of the built-in experiments.

How to write a new experiment

All experiments file have the same structure and develop in four steps. It is here that sounds are generated and least one sound needs to have a variable parameter: i.e., the stimulus level that we adaptively change during the adaptive procedure. In all built-in experiments the variable parameter is called "var_level". The experiment function must also play the sound(s) to the subject and must contain is a variable that tells the toolbox which keyboard-key corresponds to a positive answer (i.e., "pos_ans" in all built-in experiments). In yes/no tasks this variable informs the toolbox about which key the subject has to press in order to provide a yes response. In nAFC tasks, this variable informs the toolbox about the key the subject has to press to give the correct response. Moreover, it is within the experiment function that we write the experimental question the subject has to answer. The question will be echoed on screen to the subject during each trial. The last fundamental step when writing the experiment.m function pertains multiple intervals nAFC tasks only. In this kind of task the temporal order of variable and standard sound must be randomized in each trial.
Click here to see?one of the experiments currently implemented with the toolbox.

Signal generators and modifiers

STAIRCASE is provided with several signal generators and modifiers. Signal generators and modifiers are used by built-in experiment to create the sounds for the experiment. These functions can also used to create the sounds for your own experiment.
Click here to see the list of the available signal generators and modifiers.

Toolbox calibration

If you have a sound level meter and/or an artificial ear you can calibrate the toolbox. First of all, it is important to know that the level of all sounds used in the toolbox is manipulated in dB FS. That said, if you want to calibrate one experiment you need to proceed as follow. Let's suppose you want to calibrate the absolute threshold experiment. Firstly, look at the level of the sound you want to calibrate. In the absolute threshold experiment, the sound is a 1 kHz pure tone and the "starting level" of this tone is set to -10 dB FS (default value). Successively, synthesize an identical level (but longer) 1 kHz pure tone with the following commands:
    % sf = 44100;   % sample frequency
    % f = 1000;     % tone's frequency (Hz)
    % d = 10000;    % tone's duration (ms)
    % level = -10;  % tone's level (dB FS)
    % synthesize the tone
    calibration_tone = GenerateTone(sf, d, f);
    % set the level of the tone to "level"
    calibration_tone = AttenuateSound(calibration_tone, level);
Now, get your level meter, play the calibration tone and read how many dB SPL (or dBA) is displaying. To play the calibration tone in matlab use the following command:
    % play the tone with the matlab "sound" command
    sound(calibration_tone, sf)
Let's suppose your level meter is displaying "60 dB SPL". You now know the difference linking the dB FS (used within the toolbox) with the dB SPL scale (used by your sound level meter) which is +70 dB (i.e., 60 dB SPL - (-10 dB FS)). Now, run the experiment. If the threshold results -50 dB FS, the threshold expressed in dB SPL is 20 dB SPL (i.e., -50+70).

Bug/problem report

If you find a bug (or you come across a problem) when you are using the toolbox write us an email. What to write in this email

"Don't thank us. Cite us."

The toolbox is freely distributed. However, we would be happy if you would acknowledge the use of PSYCHOACOUSTICS when you publish your research [e.g., "experiments used a transformed up-down staircase (Levitt, 1971) implemented in the STAIRCASE MATLAB toolbox (Soranzo & Grassi, Frontiers in Psychology, in press)"].
The toolbox's companion paper will be available here as soon as we receive it from Frontiers.

Authors' note

STAIRCASE is constantly under development. Check the current web page for the most updated version of the toolbox. We will be happy to upload your experiments in the toolbox for free distribution.

01/03/2016. The function "PEST.m" has been bug-fixed. Many thanks to Samuele Carcagno for spotting the but.

MLP page

Those interested in MLP toolbox can refer to the MLP's web page.