A MATLAB/Psychtoolbox toolbox for validating the temporal, luminance, contrast, and spatial accuracy of display systems used in psychophysics experiments.
Vision science experiments routinely assume that a monitor presents stimuli at the requested time, luminance, contrast, and spatial frequency. This toolbox provides a standardized, repeatable set of tests to verify those assumptions on a given display setup rather than taking them for granted, and produces a self-contained report documenting the results.
The toolbox is designed to be display-agnostic. It tries to not assume any particular monitor, GPU, or operating system, in favor for all display-specific parameters being set through a single configuration file.
The toolbox runs four independent validation modules:
| Module | Name | Description |
|---|---|---|
| A | Temporal Accuracy | Measures inter-frame intervals (IFI) under idle, loaded, and long-duration presentation conditions to detect dropped or delayed frames relative to the expected refresh rate. |
| B | Luminance & Gamma | Measures luminance across a range of pixel values with an external photometer, fits the display's gamma function, and generates a gamma correction lookup table. |
| C | Contrast Precision | Measures the smallest stimulus contrast the display can reproduce reliably, useful for defining the floor of contrast-sensitivity experiments. |
| D | Spatial Accuracy | Verifies output resolution, pixel-level scaling, and the accuracy of rendered spatial frequencies (cycles per degree) against the display's Nyquist limit. |
Each module produces figures, CSV data tables, and printed diagnostics. Results from all modules are compiled into a single HTML report (report.html) with pass/fail criteria for each test.
- MATLAB (developed/tested on a recent release)
- Psychtoolbox-3
- A photometer or colorimeter (required for the Luminance & Gamma test, Module B)
- A display supporting 10-bit output is recommended for the gamma and contrast tests, but not required. Native 10-bit framebuffer output also requires GPU/driver/OS support (e.g. a Quadro/Studio-class NVIDIA card with the appropriate driver configuration on Windows, or a depth-30 Xorg configuration on Linux). If
MONITOR_BIT_PRECISIONinDVT_config.mis set to 8 or below, the toolbox will not request native 10-bit output, which avoids window-creation errors on setups that don't support it.
- Open
DVT_config.mand set the parameters for your display and viewing setup (see Configuration below). - Run
DVT_run.mfrom the project root. - For Module B (Luminance & Gamma), follow the on-screen prompts to take photometer readings at each requested pixel level.
- Results are saved to a timestamped folder under
results/, containing:report.html— a formatted summary report with figures and pass/fail statusresult.mat— all raw results as a MATLAB struct- Per-module figures (
.png) and data tables (.csv) - A generated gamma correction table (
.mat), if Module B was run
All configurable parameters live in DVT_config.m:
| Parameter | Description |
|---|---|
TEMPORAL_TRIALS_TIMING |
Number of trials for the basic and load timing tests (A1, A2) |
TEMPORAL_TRIALS_LONG_TIMING |
Number of trials for the long-run stability test (A3) |
TEMPORAL_BIN_WIDTH |
Histogram bin width (ms) for timing results |
MONITOR_BIT_PRECISION |
Bit depth of the display, used to size the gamma correction table |
MONITOR_PIXEL_WIDTH / MONITOR_PIXEL_HEIGHT |
Expected display resolution |
GAMMA_TABLE_NAME |
Filename for the saved gamma correction table |
SPATIAL_ROW_INDEX / SPATIAL_ROW_WIDTH_CHECK |
Row and range used to inspect the checkerboard pattern in the spatial test |
VIEWING_DISTANCE_M |
Viewer-to-screen distance (m), used to convert cycles/pixel to cycles/degree |
SCREEN_WIDTH_M |
Physical screen width (m) |
DVT_run.m Main entry point - initializes PTB and runs all test modules
DVT_config.m User-editable configuration
tests/ Individual test modules (temporal, gamma, contrast, spatial)
utils/ Report generation
results/ Timestamped output folders (generated at runtime)
This toolbox was developed as part of a summer research program in collaboration with KTH Royal Institute of Technology. If you use it in published work, please contact the authors for appropriate citation details.