Skip to content

NeuroTech-UCSB/MusicGenreEEG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MusicGenreEEG

A project by NeuroTech UCSB to classify music genres from EEG brain signals recorded with OpenBCI hardware.

Overview

This project explores whether EEG signals recorded while a subject listens to music can be used to decode and classify the genre being heard. Data is collected using an OpenBCI headset and processed through a pipeline of loading, filtering, and (eventually) classification.

Project Structure

MusicGenreEEG/
├── data_loader.py       # Load and parse OpenBCI CSV recordings
├── preprocessing.py     # EEG signal filtering and preprocessing
└── data/                # Place your OpenBCI .csv recordings here (gitignored)

Requirements

Install dependencies:

pip install numpy pandas scipy

Usage

Loading EEG Data

from data_loader import load_openbci, pick_file

filepath = pick_file()          # Opens a file dialog to select your OpenBCI CSV
data = load_openbci(filepath)

print(data["eeg"].shape)        # (n_samples, n_channels)
print(data["sample_rate"])      # e.g. 250 Hz
print(data["channel_names"])    # EXG channel labels

Or run directly:

python data_loader.py

Preprocessing

python preprocessing.py

This loads an OpenBCI recording via file dialog and prints basic stats on the raw EEG signal. Filtering (bandpass, notch) will be applied in this stage.

Data Format

Recordings should be in OpenBCI CSV format (.csv or .txt) as exported by the OpenBCI GUI. The loader expects:

  • Header lines prefixed with % (automatically skipped)
  • A Sample Rate line in the header comments
  • Columns named with EXG for EEG channels
  • A Timestamp column

Place data files in a data/ folder at the root of the repo (this folder is gitignored to keep raw data out of version control).

Roadmap

  • OpenBCI data loader
  • Preprocessing pipeline scaffold
  • Bandpass and notch filtering
  • Feature extraction (PSD, band power)
  • Genre labeling and dataset construction
  • ML classification model
  • Evaluation and results

Contributing

This is a NeuroTech UCSB project. Feel free to open issues or PRs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages