Class: Dct

Dct

Compute the Discrete Cosine Transform of an input signal or vector. (HTK style weighting).

support standalone usage

Constructor

new Dct(options)

Parameters:
Name Type Description
options Object

Override default parameters.

Properties
Name Type Attributes Default Description
order Number <optional>
12

Number of computed bins.

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

// assuming some audio buffer
const source = new AudioInBuffer({
  audioBuffer: audioBuffer,
  useWorker: false,
});

const slicer = new Slicer({
  frameSize: 512,
  hopSize: 512,
});

const dct = new Dct({
  order: 12,
});

const logger = new lfo.sink.Logger({ data: true });

source.connect(slicer);
slicer.connect(dct);
dct.connect(logger);

source.start();

Methods

inputSignal(values) → {Array}

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

Parameters:
Name Type Description
values Array

Input values.

Source:
Returns:
  • Dct of the input array.
Type
Array
Example
const dct = new lfo.operator.Dct({ order: 12 });
// mandatory for use in standalone mode
dct.initStream({ frameSize: 512, frameType: 'signal' });
dct.inputSignal(data);