Skip to content

laplacianSegmentation

laplacianSegmentation(features, options?): object

Defined in: packages/pleco-xa/src/segment/laplacian-segmentation.js:175

Structural segmentation of a beat/frame-synchronous feature matrix by Laplacian spectral clustering (McFee & Ellis, 2014).

Two input forms:

  • Single feature stacklaplacianSegmentation(features2d, opts): the same d×n matrix drives BOTH the recurrence graph and the path graph. Convenient when one representation must serve both roles.

  • Two-feature formlaplacianSegmentation({ recurrenceFeatures, pathFeatures }, opts): the recurrence affinity Rf is built from recurrenceFeatures and the sequential path graph R_path from pathFeatures — one feature for repetition (typically a beat-synced CQT or chroma) and another for local continuity (typically MFCC). Both matrices must share the same number of frames (columns); their feature-row counts may differ.

Float32Array<ArrayBufferLike>[] | Float64Array<ArrayBufferLike>[] | number[][] | { pathFeatures: number[][]; recurrenceFeatures: number[][]; }

A single d×n feature matrix (rows = features, columns = frames), or an object carrying separate recurrenceFeatures and pathFeatures matrices.

number = 5

Number of segments / spectral components.

number = 0.5

Balance between recurrence (Rf) and path (R_path) graphs: A = μ·Rf + (1 − μ)·R_path, μ ∈ [0, 1].

number = 3

Recurrence-matrix width band (links with |i − j| < width are suppressed; prevents same-bar self-links).

object

segmentIds[i] is the cluster label of frame i; boundaries is the ascending list of internal segment-onset frames (1 + where(segmentIds[:-1] ≠ segmentIds[1:])).

boundaries: number[]

segmentIds: Int32Array