Learn R Programming

soundgen (version 2.3.0)

selfsim: 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)

Value

Returns a square self-similarity matrix.

Details

Called by ssm.

Examples

Run this code
# NOT RUN {
m = matrix(rnorm(40), nrow = 5)
soundgen:::selfsim(m, sparse = TRUE, kernelSize = 2)
# }

Run the code above in your browser using DataLab