This repository contains a MATLAB implementation of the PEST (Parameter Estimation by Sequential Testing) algorithm based on the paper:
PEST: Efficient Estimates on Probability Functions
M. M. Taylor & C. D. Creelman, Journal of the Acoustical Society of America, 41, 782–787 (1967)
DOI:10.1121/1.1910407
The code is designed for rapid and efficient psychophysical threshold estimation. Although the original implementation was used for speed perception experiments, this version has been adapted to measure a loudness threshold using a 440 Hz sine tone. It uses an adaptive staircase procedure (N-down/M-up + PEST) to converge on a target threshold.
-
updateDiff_NdownMup.m
The main PEST function that implements the adaptive algorithm. It updates the stimulus level (e.g., loudness level in dB) and the step size based on participant responses according to the PEST rules. -
demo_loudness_threshold_and_plot.m
A combined demonstration script that:- Presents a 440 Hz tone with amplitude scaled according to the current stimulus level.
- Collects participant responses (e.g., “heard” or “not heard”).
- Updates the stimulus level using the PEST function.
- Saves and plots the staircase results.
-
LICENSE
A non-commercial license under which this code is released (see below).
-
Prerequisites:
Ensure that MATLAB (or Octave) is installed and thatupdateDiff_PEST.mis on your MATLAB path. -
Running the Demo:
Open MATLAB, navigate to the repository folder, and run:demo_loudness_threshold_and_plot
The script will run an experiment where a 440 Hz tone is played repeatedly with adaptive amplitude scaling. After the experiment, a plot of the staircase (loudness level vs. trial index) is displayed, and the results are saved to a .mat file. 3. Customizing the Code: You may modify parameters such as the down/up criteria, initial stimulus level, step sizes, and number of trials to suit your experimental design.
Citation
If you use this code in your research, please cite the original paper:
Taylor, M. M., & Creelman, C. D. (1967). PEST: Efficient Estimates on Probability Functions. The Journal of the Acoustical Society of America, 41(3), 782–787. https://doi.org/10.1121/1.1910407
License
This software is released under the Non-Commercial License (see LICENSE). Use of this code is permitted only for non-commercial research and educational purposes. Commercial use is strictly prohibited without prior written consent from the copyright holder.