selfsim: Compute self-similarity

View source: R/SSM.R

selfsimR Documentation

Compute self-similarity

Description

Internal soundgen function.

Usage

selfsim(
  m,
  norm = FALSE,
  simil = c("cosine", "cor")[1],
  win = 1,
  sparse = FALSE,
  kernelSize = NULL
)

Arguments

m

input matrix such as a spectrogram

norm

if TRUE, the spectrum of each STFT frame is normalized

simil

method for comparing frames: "cosine" = cosine similarity, "cor" = Pearson's correlation

win

the length of window for averaging self-similarity, frames

sparse

if TRUE, the entire SSM is not calculated, but only the central region needed to extract the novelty contour (speeds up the processing)

Details

Called by ssm.

Value

Returns a square self-similarity matrix.

Examples

m = matrix(rnorm(40), nrow = 5)
soundgen:::selfsim(m, sparse = TRUE, kernelSize = 2)

soundgen documentation built on Sept. 29, 2023, 5:09 p.m.