Empty room PsychoPy experiment for characterizing audio speaker artifacts in OPM-MEG recordings.
Sound and no-sound trials are randomly interleaved in a single continuous recording using a permuted block design (block size = 6): within every 6 consecutive trials there are exactly 3 sound and 3 no-sound trials in random order. This ensures tight temporal balance between conditions throughout the recording, preventing slow environmental drift from being confounded with condition.
Each sound trial plays a unique pink noise waveform (pre-generated before the experiment starts) to prevent phase-locked averaging artifacts.
Screen color changes in the blue channel encode trial type for PixelMode B hardware triggering into the MEG acquisition system. PixelMode B is enabled automatically at startup via pypixxlib and disabled cleanly on exit.
| State | RGB (0–255) | Description |
|---|---|---|
| Sound ON | (0, 0, 32) | Pink noise playing |
| No-sound ON | (0, 0, 64) | Screen only, no audio |
| ISI | (0, 0, 0) | Inter-stimulus interval |
Edit the PARAMETERS block at the top of Speakertest.py:
N_PER_CONDITION— trials per condition (default 200; 400 total)BLOCK_SIZE— trials per permuted block, must be even (default 6)BLOCK_DURATION— ON period duration in seconds (default 2.0)ISI_MIN/ISI_MAX— jittered ISI range in seconds (default 1.5–3.5s)NOISE_VOLUME— speaker volume 0–1 (default 0.8)
opm_speaker_artifact.log— full PsychoPy logopm_speaker_artifact_events.tsv— trial-by-trial onset times, block numbers, and ISI durations
- PsychoPy
- pypixxlib
- NumPy