Git Product home page Git Product logo

nose's Introduction

Nose

Informed by the wonderful MuseJS project, Nose is a Muse interpreter that runs on Node so that EEG signals can be used in data analysis, to control web server behavior, and stream to clients. For example, this was used to circumvent the lack of a free and authoritative Bluetooth library for Unity on Android.

Usage

MuseBLE is the primary module for connecting to the Muse and decoding data. Most use cases call for MuseBLE.raw(uuid). Some other functions are available:

MuseBLE = {
	raw: function(uuid: string): [
		Promise<Array<Observable<number>>>, // one Observable per channel; Promise encapsulates the connection logic
		Promise<[main_service: noble.Service, ctrl: noble.Characteristic]> // 
	],
	send_command: function(ctrl: noble.Characteristic, cmd: string, no_response: bool = true),
	FFT: function(uuid: string, FFT_WINDOW: number = 128, EDMSE_DECAY: number = 0.2): Promise<Array<Observable<dspjs.FFT>>>, // one Observable per channel; Promise encapsulates the connection logic
}

Examples

Calculate a power estimate of the brainwave signal

const BL_UUID = '00:55:da:b7:0b:a0';
MuseBLE.FFT(BL_UUID).then(S => subscribe(fft => {
	for(let i = Math.round(55 / f * y.length); i < 65 / f * y.length; i++) {
		fft.spectrum[i] = 0;
	} // blank the 60Hz noise profile
	return fft.spectrum.reduce((acc, v) => acc + v*v, 0);
});

nose's People

Contributors

acrylic-origami avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.