Class: MeanStddev

MeanStddev

Compute mean and standard deviation of a given signal.

support standalone usage

Constructor

new MeanStddev()

Source:
Example
import * as lfo from 'waves-lfo/client';

const audioContext = new AudioContext();

navigator.mediaDevices
  .getUserMedia({ audio: true })
  .then(init)
  .catch((err) => console.error(err.stack));

function init(stream) {
  const source = audioContext.createMediaStreamSource(stream);

  const audioInNode = new lfo.source.AudioInNode({
    sourceNode: source,
    audioContext: audioContext,
  });

  const meanStddev = new lfo.operator.MeanStddev();

  const traceDisplay = new lfo.sink.TraceDisplay({
    canvas: '#trace',
  });

  audioInNode.connect(meanStddev);
  meanStddev.connect(traceDisplay);
  audioInNode.start();
}

Methods

inputSignal(values) → {Array}

Use the MeanStddev operator in standalone mode (i.e. outside of a graph).

Parameters:
Name Type Description
values Array | Float32Array

Values to process.

Source:
Returns:
  • Mean and standart deviation of the input values.
Type
Array
Example
import * as lfo from 'waves-lfo/client';

const meanStddev = new lfo.operator.MeanStddev();
meanStddev.initStream({ frameType: 'vector', frameSize: 1024 });
meanStddev.inputVector(someSineSignal);
> [0, 0.7071]