All Projects â†’ pwstegman â†’ Bci.js

pwstegman / Bci.js

Licence: mit
📊 EEG signal processing and machine learning in JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Bci.js

pyRiemann
Python machine learning package based on sklearn API for multivariate data processing and statistical analysis of symmetric positive definite matrices via Riemannian geometry
Stars: ✭ 470 (+301.71%)
Mutual labels:  signal-processing, eeg
Brainflow
BrainFlow is a library intended to obtain, parse and analyze EEG, EMG, ECG and other kinds of data from biosensors
Stars: ✭ 170 (+45.3%)
Mutual labels:  signal-processing, eeg
Mne Cpp
MNE-CPP: A Framework for Electrophysiology
Stars: ✭ 104 (-11.11%)
Mutual labels:  signal-processing, eeg
antropy
AntroPy: entropy and complexity of (EEG) time-series in Python
Stars: ✭ 111 (-5.13%)
Mutual labels:  signal-processing, eeg
Wits
A Node.js library that reads your mind with Emotiv EPOC EEG headset
Stars: ✭ 73 (-37.61%)
Mutual labels:  signal-processing, eeg
brain-monitor
A terminal app written in Node.js to monitor brain signals in real-time
Stars: ✭ 119 (+1.71%)
Mutual labels:  signal-processing, eeg
Entropy
EntroPy: complexity of time-series in Python (DEPRECATED)
Stars: ✭ 142 (+21.37%)
Mutual labels:  signal-processing, eeg
python-meegkit
🔧🧠 MEEGkit: MEG & EEG processing toolkit in Python 🧠🔧
Stars: ✭ 99 (-15.38%)
Mutual labels:  signal-processing, eeg
qEEG feature set
NEURAL: a neonatal EEG feature set in Matlab
Stars: ✭ 29 (-75.21%)
Mutual labels:  signal-processing, eeg
Neurokit
NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing
Stars: ✭ 264 (+125.64%)
Mutual labels:  signal-processing, eeg
Electrophysiologysoftware
A list of openly available software tools for (mostly human) electrophysiology.
Stars: ✭ 54 (-53.85%)
Mutual labels:  eeg
Pywt
PyWavelets - Wavelet Transforms in Python
Stars: ✭ 1,098 (+838.46%)
Mutual labels:  signal-processing
Sleepeegnet
SleepEEGNet: Automated Sleep Stage Scoring with Sequence to Sequence Deep Learning Approach
Stars: ✭ 89 (-23.93%)
Mutual labels:  eeg
Eeg classification
EEG Sleep stage classification using CNN with Keras
Stars: ✭ 54 (-53.85%)
Mutual labels:  eeg
Hitchhackers guide brain
A list of tutorials and other resources useful to learn open science and neuroimaging, EEG and MEG
Stars: ✭ 85 (-27.35%)
Mutual labels:  eeg
Eulerian Remote Heartrate Detection
Remote heart rate detection through Eulerian magnification of face videos
Stars: ✭ 48 (-58.97%)
Mutual labels:  signal-processing
8d Audio
Some dsp to make songs "8D"
Stars: ✭ 43 (-63.25%)
Mutual labels:  signal-processing
Strugatzki
Algorithms for matching audio file similarities. Mirror of https://git.iem.at/sciss/Strugatzki
Stars: ✭ 38 (-67.52%)
Mutual labels:  signal-processing
Radio Transformer Networks
A PyTorch implementation of Radio Transformer Networks from the paper "An Introduction to Deep Learning for the Physical Layer".
Stars: ✭ 113 (-3.42%)
Mutual labels:  signal-processing
Adblockradio
An adblocker for live radio streams and podcasts. Machine learning meets Shazam.
Stars: ✭ 1,407 (+1102.56%)
Mutual labels:  signal-processing

Brain Computer Interfaces (BCIs) with JavaScript

Version Downloads CDN License


Getting Started

Latest release is v1.8.0. You can view the release notes at releases

Documentation is available at https://bci.js.org/docs/

Node.js

npm install bcijs

Browser

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/bci.min.js"></script>

Feature Overview

For a complete list of methods, see the docs.

Signal Processing Machine Learning Data Management
Bandpower Feature extraction Load and save CSVs (Node.js only)
Welch's method Linear discriminant analysis Load from EDF (Node.js only)
Periodogram Confusion matrices Epoch / window data
Independent component analysis Metrics (precision, recall, F1, MCC, etc.) Partition datasets
Common spatial pattern Array subscripting (colon notation)
Signal generation

Tutorials

Examples

More examples can be found in the examples directory

Bandpower

const bci = require('bcijs');

// Generate 1 second of sample data at 512 Hz
// Contains 8 ΞV / 8 Hz and 4 ΞV / 17 Hz
let samplerate = 512;
let signal = bci.generateSignal([8, 4], [8, 17], samplerate, 1);

// Compute relative power in each frequency band
let bandpowers = bci.bandpower(signal, samplerate, ['alpha', 'beta'], {relative: true});

console.log(bandpowers); // [ 0.6661457715567836, 0.199999684787573 ]

Epoch data

let samples = [[1,2], [3,4], ...] // 2D array where rows are samples and columns are channels
let samplerate = 256; // 256 Hz

// Epoch data into epochs of 256 samples with a step of 64 (75% overlap)
// Then find the average alpha and beta powers in each epoch.
let powers = bci.windowApply(
	samples,
	epoch => bci.bandpower(epoch, samplerate, ['alpha', 'beta'], {average: true}),
	256,
	64
);

Subscript

const bci = require('bcijs');

// 5 samples of data from 3 channels 
let signal = [[1,2,3], [5,3,4], [4,5,6], [7,5,8], [4,4,2]];

// Select the first 3 samples from channels 1 and 3
let subset = bci.subscript(signal, '1:3', '1 3'); // [ [ 1, 3 ], [ 5, 4 ], [ 4, 6 ] ]

Linear discriminant analysis

const bci = require('bcijs');

// Training set
let class1 = [[0, 0], [1, 2], [2, 2], [1.5, 0.5]];
let class2 = [[8, 8], [9, 10], [7, 8], [9, 9]];

// Testing set
let unknownPoints = [[-1, 0], [1.5, 2],	[7, 9], [10, 12]];

// Learn an LDA classifier
let ldaParams = bci.ldaLearn(class1, class2);

// Test classifier
let predictions = bci.ldaClassify(ldaParams, unknownPoints);

console.log(predictions); // [ 0, 0, 1, 1 ]

Check out https://bci.js.org/examples/lda for a visual demo of how LDA works

Usage in the web

BCI.js can be loaded from the jsDelivr CDN with

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/bci.min.js"></script>

You can also find bci.js and bci.min.js at releases.

BCI.js methods are accessible via the global object bci.

If building a web distributable using a tool such as browserify or webpack, require bcijs/browser.js to load only methods that are browser compatible. Node.js specific methods such as networking and file system methods will not be included.

const bci = require('bcijs/browser.js');

Requiring specific methods

You can require specific methods as well. For example, if you only need fastICA, you can use

const fastICA = require('bcijs/lib/math/fastICA.js');

BCI.js methods can be found in the src/ directory.

Files are transpiled from ES6 import/export (in src/) to CommonJS (generated lib/) on npm install.

Documentation

Documentation can be found at https://bci.js.org/docs or by viewing api.md

Deprecated methods can be found at deprecated.md

Building

See dev.md for info on how to modify and build BCI.js

Reference

BCI.js began as WebBCI, a library developed to aid in my research at the Human Technology Interaction Lab at the University of Alabama Department of Computer Science. If you use BCI.js in a published work, please reference this paper

P. Stegman, C. Crawford, and J. Gray, "WebBCI: An Electroencephalography Toolkit Built on Modern Web Technologies," in Augmented Cognition: Intelligent Technologies, 2018, pp. 212–221.

Logo uses icon from Font Awesome.

Contact

If you have a commercial use case for BCI.js and would like to discuss working together, contact me at [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].