Learn R Programming

soundgen (version 2.9.0)

.ssm: SSM per sound

Description

Internal soundgen function.

Usage

.ssm(
  audio,
  sparse = FALSE,
  input = c("melspec", "mfcc", "spec", "audSpec")[1],
  melfcc_pars = list(windowLength = 125, step = 25, nbands = 50),
  MFCC = 2:13,
  audSpec_pars = list(nFilters = 16, step = 10),
  takeLog = FALSE,
  norm = FALSE,
  simil = c("cosine", "cor")[1],
  kernelLen = 100,
  kernelSD = 0.5,
  padWith = 0,
  win = 1,
  output = c("ssm", "novelty", "summary"),
  plot = TRUE,
  main = NULL,
  heights = c(2, 1),
  width = 900,
  height = 500,
  units = "px",
  res = NA,
  specPars = list(colorTheme = c("bw", "seewave", "heat.colors", "...")[2], xlab =
    "Time, s", ylab = "kHz"),
  ssmPars = list(colorTheme = c("bw", "seewave", "heat.colors", "...")[2], xlab =
    "Time, s", ylab = "Time, s"),
  noveltyPars = list(type = "b", pch = 16, col = "black", lwd = 3)
)

Arguments

audio

a list returned by readAudio

sparse

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

input

the spectral representation used to calculate the SSM: "audSpec" = auditory spectrogram returned by audSpectrogram, "mfcc" = Mel-Frequency Cepstral coefficients, "melspec" = Mel-transformed STFT spectrogram, "spec" = STFT power spectrogram (all three returned by melfcc). Any custom spectrogram-like matrix of features (time in columns labeled in s, features in rows) is also accepted (see examples)

melfcc_pars

a list of parameters passed to melfcc

MFCC

which mel-frequency cepstral coefficients to use; defaults to 2:13

audSpec_pars

a list of parameters passed to audSpectrogram (if input = 'audSpec')

takeLog

if TRUE, the input is log-transformed prior to calculating self-similarity

norm

if TRUE, the spectrum of each STFT frame is normalized

simil

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

kernelLen

length of checkerboard kernel for calculating novelty, ms (larger values favor global, slow vs. local, fast novelty)

kernelSD

SD of checkerboard kernel for calculating novelty

padWith

how to treat edges when calculating novelty: NA = treat sound before and after the recording as unknown, 0 = treat it as silence

output

what to return (drop "ssm" to save memory when analyzing a lot of files)

plot

if TRUE, plots the SSM

main

plot title

heights

relative sizes of the SSM and spectrogram/novelty plot

width, height, units, res

graphical parameters for saving plots passed to png

specPars

graphical parameters passed to filled.contour.mod and affecting the spectrogram

ssmPars

graphical parameters passed to filled.contour.mod and affecting the plot of SSM

noveltyPars

graphical parameters passed to lines and affecting the novelty contour