Skip to content

mrribbits/MEG-speaker-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

OPM-MEG Speaker Artifact Detection

Empty room PsychoPy experiment for characterizing audio speaker artifacts in OPM-MEG recordings.

Design

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

Parameters

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)

Output

  • opm_speaker_artifact.log — full PsychoPy log
  • opm_speaker_artifact_events.tsv — trial-by-trial onset times, block numbers, and ISI durations

Requirements

  • PsychoPy
  • pypixxlib
  • NumPy

About

Simple Psychopy script that plays pink noise trials and no noise trials. Uses VPIXX Pixel Mode triggers to mark the trials. Use this during an empty room recording to check for any speaker-induced artifacts.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages