Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

SSVEP-Based BCI Task (4-Target)

A MATLAB implementation of a visual Steady-State Visually Evoked Potential (SSVEP) Brain-Computer Interface (BCI) task using Psychtoolbox. This project simulates a classic SSVEP paradigm with four flickering targets and real-time visual feedback.


🧠 Overview

This task presents four visual stimuli (squares) flickering at distinct frequencies (8, 10, 12, and 14 Hz). A central circle provides real-time feedback by smoothly moving toward the selected target upon mouse click. The implementation is designed for BCI prototyping, neuroscience education, and SSVEP mechanism demonstration.


✨ Features

  • Four flickering targets positioned at cardinal directions (0°, 90°, 180°, 270°)
  • Precise flicker control using monitor refresh rate and frame counting
  • Smooth visual feedback with animated central circle movement
  • Interactive selection via mouse click (simulating BCI command)
  • Configurable parameters: frequencies, positions, colors, speeds
  • Robust error handling and clean screen management

📁 Repository Structure

├── SSVEP_Task_4Targets.m    # Main task script (4-target version)
├── SSVEP_Task_8Targets.m    # Extended 8-target version (if available)
└── README.md

🚀 How to Run

Prerequisites

Steps

  1. Clone this repository.
  2. Open MATLAB and navigate to the project folder.
  3. Run the main script:
    SSVEP_Task_4Targets
  4. Click on any flickering square to see the feedback circle move toward it.
  5. Press any key to exit.

⚙️ Key Parameters (Customizable)

Parameter Default Value Description
Frequencies [8, 10, 12, 14] Hz Flicker frequencies for each target
Radius 200 px Distance of targets from center
Square Size 80 px Size of each flickering square
Background Gray (50%) Screen background color
Move Speed 12 px/frame Speed of feedback circle

🔧 Code Highlights

  • Frame-based flicker timing: Uses Screen('Flip') and frame counting for accurate frequency control.
  • Vector-based animation: Smooth interpolation for circle movement.
  • Modular structure: Easy to extend (e.g., to 8 targets or different layouts).

👥 Contributing

Feel free to fork and extend this project. Possible improvements:

  • Add EEG triggering via parallel port or TCP/IP.
  • Implement dynamic frequency/position configuration.
  • Integrate with actual BCI classification pipeline.

📜 License

This project is provided for educational and research purposes.


About

MATLAB/Psychtoolbox implementation of a 4-target SSVEP-based BCI task. Visual stimuli flicker at 8,10,12,14Hz with real-time feedback via a moving circle.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages