getMelSpec: Mel-transformed spectrogram

View source: R/compareSounds.R

getMelSpecR Documentation

Mel-transformed spectrogram

Description

Internal soundgen function

Usage

getMelSpec(
  s,
  samplingRate = NULL,
  windowLength = 40,
  overlap = 50,
  step = NULL,
  dynamicRange = 80,
  maxFreq = NULL,
  specPars = list(),
  plot = FALSE
)

Arguments

s

input sound (path to a .wav file or numeric vector)

samplingRate

if one or both inputs are numeric vectors, specify sampling rate, Hz. A vector of length 2 means the two inputs have different sampling rates, in which case spectrograms are compared only up to the lower Nyquist frequency

windowLength

length of FFT window, ms

overlap

overlap between successive FFT frames, %

step

you can override overlap by specifying FFT step, ms (NB: because digital audio is sampled at discrete time intervals of 1/samplingRate, the actual step and thus the time stamps of STFT frames may be slightly different, eg 24.98866 instead of 25.0 ms)

dynamicRange

parts of the spectra quieter than -dynamicRange dB are not compared

maxFreq

parts of the spectra above maxFreq Hz are not compared

specPars

a list of parameters passed to melfcc

plot

if TRUE, plots the spectrum

Details

Takes a .wav file or a waveform as numeric vector + samplingRate and returns mel-transformed spectrum (auditory spectrum). Calls melfcc. See compareSounds.


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