PsychDetect is a software framework for conducting acoustic psychophysical experiments.
It is less a single ready-to-use program to immediately run experiments, but rather it provides components to build and set up a program to your own needs. (But see also the motivation section for the idea behind PsychDetect.)
The main components are:
- an experiment controller for controlling a go/no go detection experiment
- auditory stimuli
- an audio player that plays those stimuli
- a stimulus generator that provides stimuli to play
- an I/O interface through which the subject can react upon stimuli and get feedback about his performance
- a logbook that keeps track of experimental events like stimulus presentation and subject responses
PsychDetect needs at least Matlab Version 2015b. (It has not been tested for newer versions yet.)
In addition, you need the following toolboxes to be installed and to be added to your Matlab path:
You need a sound device that fulfils your specific needs. We run the software on a Windows machine with a high-end ASIO sound device with 192 kHz sampling rate for ultrasonic stimulation. We also tested the software with a common “sound on board” device at different sampling rates. Both set-ups run without latency issues.
- Clone the repository or download the zip-archive and extract it at your preferred location.
- Add the directory PsychDetect/src/ to your Matlab path.
- Run
setupSystem
. This will create a directory experiment_config within your home directory to which configuration settings will be saved. It will also create a directory structure to which experimental data will be saved. You can change the default of the latter by specifying an alternative path as argument tosetupSystem
. Typehelp setupSystem
for more information. - Change to PsychDetect/test/, type
runtests
, and verify that all tests pass.
Within PsychDetect/test/, type runExampleGapSession
to run a demonstration of a psychoacoustic gap detection experiment.
The demonstration program will open two windows. The left window lets you control the experiment. It contains buttons for starting, stopping, and saving the experimental session. The right window is a demo implementation of the subject's I/O device. The subject uses it to initiate trials, to respond upon detected stimuli, and to get feedback about his performance.
- Focus on the left window and click on Start. This will make the audio player playing white noise.
- Focus on the right window and hold down the Control key (Ctrl) to initiate a trial.
- After a random delay, the audio player will insert a small gap of silence into the noise.
- Release the Control key as soon as you identify a gap.
- If you are correct, Reward will light up at the subject's I/O window.
- Again, hold down the Control key to initiate the next trial. Steps 3 to 6 will repeat until all trials have been played. Notice that there will also be catch trials, that are trials with a gap length of zero, intermixed with regular trials. See the Wiki for more information about experimentation and the go/no go procedure.
- After all trials have been played, the audio player will stop playing noise. You can save the session's data by clicking on “Save”.
Throughout the hole session, you can survey all experimental events at Matlab's console.
This project has a Wiki!
The main goal of making our experimental software publicity available as an open source project is to allow other researchers to understand, how we conduct our experiments.
Researchers often fail in replicating experimental results from other labs. Partially, this might be related to major or minor differences in the experimental set-up or procedure. Space in method sections of scientific journals is limited. Since research in neuroscience is becoming increasingly complex, the information provided by journals (including supplementary information that is sometimes available via websites), does not suffice to replicate an experiment in every detail.
Neuroscience makes use of computer programs for many year now, e. g. for stimulation or data acquisition. Those programs are becoming more and more sophisticated and can have dramatic impact on results. Despite of their importance, they are barely accessible.
We want to encourage other scientist to share their software, too. Therefore, our software is licensed under the GNU General Public License (GPL). GPL is a copyleft license that allows you to use, change, and redistribute the software while the GPL license must be retained. That means that the software must be kept open source.
In principle, the software is set out to be platform independent, but it is currently tested on Windows only. Most likely, AudioPlayer needs some adaptation to find the right sound device.
At the moment, ContinuousBgndAudioPlayer
, which is the implementation of AudioPlayer
we are using most, uses Matlab timer objects to continuously fill the audio buffer. The problem with Matlab timers is that their underlying thread runs with standard priority. If the CPU gets under heavy load, it can and occasionally does lead to buffer underflows. Code that is directly involved in filling the audio buffer should run on a high priority thread. It would be desirable to transfer AudioPlayer and related classes to C/C++ code, where it is possible to exert more influence on thread priority. (Here is more information about this topic.)