Skip to content

dtw

dtw(X?, Y?, options?): object

Defined in: packages/pleco-xa/src/sequence/dtw.js:182

Dynamic time warping between two feature sequences (or a precomputed cost matrix).

(number[] | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>)[] = null

Feature matrix, shape (d, N) — rows are features, columns are frames. Pass null when supplying options.C.

(number[] | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>)[] = null

Feature matrix, shape (d, M). Pass null when supplying options.C.

boolean

also return the warping path.

number

band radius as a fraction of min(N, M).

number[][]

precomputed cost matrix (N, M). Mutually exclusive with X/Y.

boolean

Sakoe-Chiba band.

string

boolean

also return the step matrix.

number[][]

custom steps, APPENDED to the defaults.

boolean

subsequence DTW.

number[]

additive step weights.

number[]

multiplicative step weights.

object

D is the (N, M) accumulated cost matrix (D[N-1][M-1] is the total alignment cost). wp (when backtrack) is the warping path from the end of the alignment down to its start.

D: Float64Array<ArrayBufferLike>[]

optional steps?: Int32Array<ArrayBufferLike>[]

optional wp?: number[][]