Function
Static Public Summary | ||
public |
Annotates stream with user-defined metadata |
|
public |
addSignalQuality(options: Object): Observable<Epoch> |
|
public |
alphaPower(): Observable<Array<number>> Returns the average alpha power from a stream of PSDs |
|
public |
averageDeep(): Observable |
|
public |
averagePower(): Observable Takes a stream of PSDs and returns a sream of arrays, containing the average power in each channel |
|
public |
bandpassFilter(options: Object): Observable<Sample|Epoch> Applies a bandpass filter to EEG Data. |
|
public |
Returns the average beta power from a stream of PSDs |
|
public |
Takes a stream of Samples and applies a Fast Fourier Transform to return a stream of PSDs (Power Spectral Density). |
|
public |
bufferToEpoch(options: Object): Observable<Epoch> Takes an array or RxJS buffer of EEG Samples and returns an Epoch. |
|
public |
createEEG(objectPattern: {"channels": *, "samplingRate": *, "mock": *, "NaNRange": *, "sine": *, "csv": *}) |
|
public |
createMockStream(options: {}): * |
|
public |
deltaPower(): Observable<Array<number>> Returns the average delta power from a stream of PSDs |
|
public |
Converts a stream of individual Samples of EEG data into a stream of Epochs of a given duration emitted at specified interval. |
|
public |
Applies a Fast Fourier Transform to a stream of Epochs of EEG data and returns a stream of PSDs (Power Spectral Density). |
|
public |
gammaPower(): Observable<Array<number>> Returns the average gamma power from a stream of PSDs |
|
public |
Get a 2D data array organized by channel from an array of Samples. |
|
public |
highpassFilter(options: Object): Observable<Sample|Epoch> Applies a highpass filter to EEG Data. |
|
public |
isEpoch(eegObject: *) |
|
public |
lowpassFilter(options: Object): Observable<Sample|Epoch> Applies a lowpass filter to EEG Data. |
|
public |
max(array: *) A collection of useful statistics functions Adapted from Daniel Hug's gist: https://gist.github.com/Daniel-Hug/7273430 |
|
public |
mean(array: *) |
|
public |
meanAbsoluteDeviation(array: *): * |
|
public |
min(array: *) |
|
public |
notchFilter(options: Object): Observable<Sample|Epoch> Applies a notch filter to EEG Data. |
|
public |
pickChannels(options: Object): Observable |
|
public |
powerByBand(bands: Object): Observable<Array<number>> Takes a stream of PSDs and returns the average power for each of the classic EEG bands (alpha, beta, theta, etc.). |
|
public |
range(array: *) |
|
public |
removeChannels(options: Object): Observable |
|
public |
Slices a stream of PSDs to a specific frequency range defined by a minimum and maximum frequency in Hz |
|
public |
standardDeviation(array: *) |
|
public |
sum(array: *): * |
|
public |
thetaPower(): Observable<Array<number>> Returns the average theta power from a stream of PSDs |
|
public |
variance(array: *): * |
|
public |
voltsToMicrovolts(options: Object): Observable<Sample|Epoch> Converts a stream of EEG data (either eegObjects or Epochs) from volts to microvolts |
|
public |
zeroPad(Array ZeroPads inputs for FFTs of non base 2 |
Static Public
public addInfo(info: Object): Observable<Sample|Epoch|PSD> source
import {addInfo} from '@neurosity/pipes/src/pipes/utility/addInfo.js'
Annotates stream with user-defined metadata
Params:
Name | Type | Attribute | Description |
info | Object | Info to be added to the EEG stream. Relevant info may include: |
Return:
Observable<Sample|Epoch|PSD> |
Example:
eeg$.pipe(addinfo({ samplingRate: 256, channelNames: ["Af7", "Fp1", "Fp2", "Af8"] })
public addSignalQuality(options: Object): Observable<Epoch> source
import {addSignalQuality} from '@neurosity/pipes/src/pipes/utility/addSignalQuality.js'
Return:
Observable<Epoch> |
Example:
eeg$.pipe(addSignalQuality())
public alphaPower(): Observable<Array<number>> source
import {alphaPower} from '@neurosity/pipes/src/pipes/frequency/alphaPower.js'
Returns the average alpha power from a stream of PSDs
Example:
eeg$.pipe(epoch({ duration: 256, interval: 100, samplingRate: 256 }), fft({ bins: 256 }), alphaPower())
public averageDeep(): Observable source
import {averageDeep} from '@neurosity/pipes/src/pipes/reducer/averageDeep.js'
Return:
Observable | average |
public averagePower(): Observable source
import {averagePower} from '@neurosity/pipes/src/pipes/frequency/averagePower.js'
Takes a stream of PSDs and returns a sream of arrays, containing the average power in each channel
Return:
Observable | band powers array |
Example:
eeg$.pipe(epoch({ duration: 256, interval: 100, samplingRate: 256 }), fft({ bins: 256 }), sliceFFT(10, 20), averagePower())
public bandpassFilter(options: Object): Observable<Sample|Epoch> source
import {bandpassFilter} from '@neurosity/pipes/src/pipes/filtering/bandpassFilter.js'
Applies a bandpass filter to EEG Data. Can be applied to both raw or epoched data
Params:
Name | Type | Attribute | Description |
options | Object | Filter options |
|
options.nbChannels | number | Number of channels |
|
options.cutoffFrequencies | Array<number> |
|
Low and high cutoff frequencies in Hz |
options.samplingRate | number |
|
Sampling rate of the EEG device |
options.characteristic | string |
|
Filter characteristic. Options are 'bessel' and 'butterworth' |
options.order | number |
|
The number of 2nd order biquad filters applied to the signal |
Return:
Observable<Sample|Epoch> |
Example:
eeg$
.pipe(bandpassFilter({ cutoffFrequencies: [2, 50], nbChannels: 4 }))
public betaPower(): Observable<Array<number>> source
import {betaPower} from '@neurosity/pipes/src/pipes/frequency/betaPower.js'
Returns the average beta power from a stream of PSDs
Example:
eeg$.pipe(epoch({ duration: 256, interval: 100, samplingRate: 256 }), fft({ bins: 256 }), betaPower())
public bufferFFT(options: Object): Observable source
import {bufferFFT} from '@neurosity/pipes/src/pipes/frequency/bufferFFT.js'
Takes a stream of Samples and applies a Fast Fourier Transform to return a stream of PSDs (Power Spectral Density). Note: this operator works by buffering the stream of samples into buffers that are as long as the supplied number of bins. Because it doesn't allow as much flexibility in terms of how often data is emitted we recommend using a combination of the epoch
and fft
operators instead.
Return:
Observable |
Example:
eeg$.pipe(bufferFFT({ bins: 1024 }))
public bufferToEpoch(options: Object): Observable<Epoch> source
import {bufferToEpoch} from '@neurosity/pipes/src/pipes/utility/bufferToEpoch.js'
Takes an array or RxJS buffer of EEG Samples and returns an Epoch.
Return:
Observable<Epoch> |
Example:
eeg$.pipe(bufferTime(1000), bufferToEpoch({ samplingRate: 256 }))
public createEEG(objectPattern: {"channels": *, "samplingRate": *, "mock": *, "NaNRange": *, "sine": *, "csv": *}) source
import {createEEG} from '@neurosity/pipes/src/utils/createEEG.js'
Params:
Name | Type | Attribute | Description |
objectPattern | {"channels": *, "samplingRate": *, "mock": *, "NaNRange": *, "sine": *, "csv": *} |
|
public createMockStream(options: {}): * source
import {createMockStream} from '@neurosity/pipes/src/utils/createMockStream.js'
Params:
Name | Type | Attribute | Description |
options | {} |
|
Return:
* |
public deltaPower(): Observable<Array<number>> source
import {deltaPower} from '@neurosity/pipes/src/pipes/frequency/deltaPower.js'
Returns the average delta power from a stream of PSDs
Example:
eeg$.pipe(epoch({ duration: 256, interval: 100, samplingRate: 256 }), fft({ bins: 256 }), deltaPower())
public epoch(options: Object): Observable source
import {epoch} from '@neurosity/pipes/src/pipes/utility/epoch.js'
Converts a stream of individual Samples of EEG data into a stream of Epochs of a given duration emitted at specified interval. This operator functions similarly to a circular buffer internally and allows overlapping Epochs of data to be emitted (e.g. emitting the last one second of data every 100ms).
Params:
Name | Type | Attribute | Description |
options | Object | Epoching options |
|
options.duration | number |
|
Number of samples to include in each epoch |
options.interval | number |
|
Time (ms) between emitted Epochs |
options.samplingRate | number |
|
Sampling rate |
options.dataProp | string |
|
Name of the key associated with eeg data |
Return:
Observable | Epoch |
Example:
eeg$.pipe(epoch({ duration: 1024, interval: 100, samplingRate: 256 }))
public fft(options: Object): Observable<PSD> source
import {fft} from '@neurosity/pipes/src/pipes/frequency/fft.js'
Applies a Fast Fourier Transform to a stream of Epochs of EEG data and returns a stream of PSDs (Power Spectral Density). Frequency resolution will be samplingRate / bins. If input Epoch duration is not equal to bins, data will be zero-padded or sliced so that is the same length as bins.
Return:
Observable<PSD> |
Example:
eeg$.pipe(epoch({ duration: 256, interval: 100, samplingRate: 256 }), fft({ bins: 256 }))
public gammaPower(): Observable<Array<number>> source
import {gammaPower} from '@neurosity/pipes/src/pipes/frequency/gammaPower.js'
Returns the average gamma power from a stream of PSDs
Example:
eeg$.pipe(epoch({ duration: 256, interval: 100, samplingRate: 256 }), fft({ bins: 256 }), gammaPower())
public groupByChannel(samplesBuffer: Array<Sample>, dataProp: string): Array<Array<number>> source
import {groupByChannel} from '@neurosity/pipes/src/utils/groupByChannel.js'
Get a 2D data array organized by channel from an array of Samples. Credit to Ken from Seattle's elegant transposition http://www.codesuck.com/2012/02/transpose-javascript-array-in-one-line.html
public highpassFilter(options: Object): Observable<Sample|Epoch> source
import {highpassFilter} from '@neurosity/pipes/src/pipes/filtering/highpassFilter.js'
Applies a highpass filter to EEG Data. Can be applied to both raw or epoched data
Params:
Name | Type | Attribute | Description |
options | Object | Filter options |
|
options.nbChannels | number | Number of channels |
|
options.cutoffFrequency | number |
|
Cutoff frequency in Hz |
options.samplingRate | number |
|
Sampling rate of the EEG device |
options.characteristic | string |
|
Filter characteristic. Options are 'bessel' and 'butterworth' |
options.order | number |
|
The number of 2nd order biquad filters applied to the signal |
Return:
Observable<Sample|Epoch> |
Example:
eeg$
.pipe(highpassFilter({ cutoffFrequency: 2, nbChannels: 4 }))
public isEpoch(eegObject: *) source
import {isEpoch} from '@neurosity/pipes/src/utils/isEpoch.js'
Params:
Name | Type | Attribute | Description |
eegObject | * |
public lowpassFilter(options: Object): Observable<Sample|Epoch> source
import {lowpassFilter} from '@neurosity/pipes/src/pipes/filtering/lowpassFilter.js'
Applies a lowpass filter to EEG Data. Can be applied to both raw or epoched data
Params:
Name | Type | Attribute | Description |
options | Object | Filter options |
|
options.nbChannels | number | Number of channels |
|
options.cutoffFrequency | number |
|
Cutoff frequency in Hz |
options.samplingRate | number |
|
Sampling rate of the EEG device |
options.characteristic | string |
|
Filter characteristic. Options are 'bessel' and 'butterworth' |
options.order | number |
|
The number of 2nd order biquad filters applied to the signal |
Return:
Observable<Sample|Epoch> |
Example:
eeg$
.pipe(lowpassFilter({ cutoffFrequency: 50, nbChannels: 4 }))
public max(array: *) source
import {max} from '@neurosity/pipes/src/utils/stats.js'
A collection of useful statistics functions Adapted from Daniel Hug's gist: https://gist.github.com/Daniel-Hug/7273430
Params:
Name | Type | Attribute | Description |
array | * |
public mean(array: *) source
import {mean} from '@neurosity/pipes/src/utils/stats.js'
Params:
Name | Type | Attribute | Description |
array | * |
public meanAbsoluteDeviation(array: *): * source
import {meanAbsoluteDeviation} from '@neurosity/pipes/src/utils/stats.js'
Params:
Name | Type | Attribute | Description |
array | * |
Return:
* |
public min(array: *) source
import {min} from '@neurosity/pipes/src/utils/stats.js'
Params:
Name | Type | Attribute | Description |
array | * |
public notchFilter(options: Object): Observable<Sample|Epoch> source
import {notchFilter} from '@neurosity/pipes/src/pipes/filtering/notchFilter.js'
Applies a notch filter to EEG Data. Can be applied to both raw or epoched data. Has the ability to filter out harmonics of line noise (e.g. 120Hz, 180Hz), though this is only needed for high-frequency devices with >= 1000hz sampling rate
Params:
Name | Type | Attribute | Description |
options | Object | Filter options |
|
options.nbChannels | number | Number of channels |
|
options.cutoffFrequency | number |
|
Cutoff frequency in Hz |
options.bandWidth | number |
|
Width of the cutoff centered around the notched frequency. Larger values reduce filter out more of the notch frequency at the cost of also reducing nearby frequencies |
options.filterHarmonics | boolean |
|
Whether to filter harmonics of the notch frequency as well |
options.samplingRate | number |
|
Sampling rate of the EEG device |
options.characteristic | string |
|
Filter characteristic. Options are 'bessel' and 'butterworth' |
options.order | number |
|
Number of 2nd order biquad filters applied to the signal |
Return:
Observable<Sample|Epoch> |
Example:
eeg$
.pipe(notchFilter({ cutoffFrequency: 60, nbChannels: 10, samplingRate: 1000, filterHarmonics: true }))
public pickChannels(options: Object): Observable source
import {pickChannels} from '@neurosity/pipes/src/pipes/utility/pickChannels.js'
Params:
Name | Type | Attribute | Description |
options | Object |
Return:
Observable | sample |
public powerByBand(bands: Object): Observable<Array<number>> source
import {powerByBand} from '@neurosity/pipes/src/pipes/frequency/powerByBand.js'
Takes a stream of PSDs and returns the average power for each of the classic EEG bands (alpha, beta, theta, etc.). Classic EEG bands can be overridden by providing a custom bands object (e.g. { lowAlpha: [7.5, 10], highAlpha: [10, 12.5] })
Params:
Name | Type | Attribute | Description |
bands | Object |
|
Custom bands object containing corresponding names and frequency ranges |
Example:
eeg$.pipe(epoch({ duration: 256, interval: 100, samplingRate: 256 }), fft({ bins: 256 }), powerByBand())
public range(array: *) source
import {range} from '@neurosity/pipes/src/utils/stats.js'
Params:
Name | Type | Attribute | Description |
array | * |
public removeChannels(options: Object): Observable source
import {removeChannels} from '@neurosity/pipes/src/pipes/utility/removeChannels.js'
Params:
Name | Type | Attribute | Description |
options | Object |
Return:
Observable | sample |
public sliceFFT(range: Array<number>): Observable<PSD> source
import {sliceFFT} from '@neurosity/pipes/src/pipes/frequency/sliceFFT.js'
Slices a stream of PSDs to a specific frequency range defined by a minimum and maximum frequency in Hz
Return:
Observable<PSD> |
Example:
eeg$.pipe(epoch({ duration: 256, interval: 100, samplingRate: 256 }), fft({ bins: 256 }), sliceFFT([2, 30]))
public standardDeviation(array: *) source
import {standardDeviation} from '@neurosity/pipes/src/utils/stats.js'
Params:
Name | Type | Attribute | Description |
array | * |
public sum(array: *): * source
import {sum} from '@neurosity/pipes/src/utils/stats.js'
Params:
Name | Type | Attribute | Description |
array | * |
Return:
* |
public thetaPower(): Observable<Array<number>> source
import {thetaPower} from '@neurosity/pipes/src/pipes/frequency/thetaPower.js'
Returns the average theta power from a stream of PSDs
Example:
eeg$.pipe(epoch({ duration: 256, interval: 100, samplingRate: 256 }), fft({ bins: 256 }), thetaPower())
public variance(array: *): * source
import {variance} from '@neurosity/pipes/src/utils/stats.js'
Params:
Name | Type | Attribute | Description |
array | * |
Return:
* |
public voltsToMicrovolts(options: Object): Observable<Sample|Epoch> source
import {voltsToMicrovolts} from '@neurosity/pipes/src/pipes/unit/voltsToMicrovolts.js'
Converts a stream of EEG data (either eegObjects or Epochs) from volts to microvolts
Return:
Observable<Sample|Epoch> |
Example:
eeg&.pipe(toMicrovolts)
public
zeroPad(Array: *, number: *): *
source
import {zeroPad} from '@neurosity/pipes/src/utils/zeroPad.js'
ZeroPads inputs for FFTs of non base 2
Params:
Name | Type | Attribute | Description |
Array<number> | * | bufferedData |
|
number | * | fftLength |
Return:
* | Array<number> |