Use two screens: one for visual stimulation, and one to set and control the visual stimulation protocol.
1. Select the screen for visual stimulation.
2. Turn on the app switch to initialize the monitor (using Psychtoolbox functions).
3. Set the parameters of the drifting gratings: directions, size and frequency.
4. Set if you want a random sequence and if you want sinusoidal gratings.
5. (Optional) Select an output voltage channel of a NI-DAQ for recording the type and time of the stimulation.
6. Set the duration of the stimulus, the duration of gray screen between stimulus and the number of repetitions.
7. Preview the visual stimulation protocol and the total time on the right panel.
8. Press Run to start the protocol.
You need a NI-DAQ to send an analog output to record the type and time of visual stimulation. Output voltage of 0 V means no visual stimulation (gray screen), different values mean different directions. For example, if you choose 8 different directions (0º, 45º, 90º, 135º, 180º, 225º, 270º and 315º) the output voltage will use 8 different levels of voltage in order to identify them (0.5, 1, 1.5, 2, 2.5, 3, 3.5 and 4 V).
Jesus Perez (2021). Drifting gratings generator for visual stimulation (https://www.mathworks.com/matlabcentral/fileexchange/78670-drifting-gratings-generator-for-visual-stimulation), MATLAB Central File Exchange. Retrieved .
Inspired by: Psychtoolbox-3
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!