Skip to content

v1.7.0

Compare
Choose a tag to compare
@pwstegman pwstegman released this 11 Apr 14:39
· 39 commits to master since this release

Release Notes

Added Periodogram Method

The periodogram method was added as a method to estimate the power spectral density (PSD) of a signal. It returns an object containing the PSD estimates and their corresponding frequencies.

Units of the estimates are the squared units of the input signal per Hz. For example, if the input signal is μV, then the PSD estimates are μV²/Hz.

let psd = bci.periodogram(signal, sample_rate);
console.log(psd.estimates); // Array of estimates, units of μV²/Hz for μV signal
console.log(psd.frequencies); // Array of corresponding frequencies, units of Hz

For more info, see https://bci.js.org/docs/module-bcijs.html#.periodogram

Added New Bandpower Method

The new bandpower method is more extensive and returns values in proper units (squared units of input signal, ex: μV² if the input signal is measured in μV). It supports single channel or multi channel input. It also allows for the calculation of relative bandpower (the power in a frequency band divided by the total power, unitless), as well as bandpower averaged across channels (ex: alpha power averaged across all channels).

let powers = bci.bandpower(signal, sample_rate, ['alpha', 'beta'], {relative: true});
// Returns an array containing the relative alpha power and the relative beta power

For more info, see https://bci.js.org/docs/module-bcijs.html#.bandpower

Deprecated Methods

The below methods have been deprecated in this release and have been replaced with the new periodogram and bandpower methods listed above. The methods shown below do not scale outputs to the proper units. The new methods correct this issue.

  • signalBandPower replaced by bandpower
  • averageBandPowers replaced by bandpower with the option {average: true}
  • psdBandPower replaced by bandpower with the option {input: 'psd'}
  • psd replaced with periodogram