soundgen (version 1.5.0)

modulationSpectrumFolder: Modulation spectrum per folder

Description

Extracts modulation spectra of all wav/mp3 files in a folder - separately for each file, without averaging. Good for saving plots of the modulation spectra and/or measuring the roughness of multiple files. See modulationSpectrum for further details.

Usage

modulationSpectrumFolder(myfolder, summary = TRUE, htmlPlots = TRUE,
  verbose = TRUE, maxDur = 5, logSpec = FALSE, windowLength = 25,
  step = NULL, overlap = 80, wn = "gaussian", zp = 0, power = 1,
  roughRange = c(30, 150), plot = FALSE, savePlots = FALSE,
  logWarp = 2, quantiles = c(0.5, 0.8, 0.9), kernelSize = 5,
  kernelSD = 0.5, colorTheme = c("bw", "seewave", "...")[1],
  xlab = "Hz", ylab = "1/KHz", width = 900, height = 500,
  units = "px", res = NA, ...)

Arguments

myfolder

full path to target folder

summary

if TRUE, returns only a summary of the measured acoustic variables (mean, median and SD). If FALSE, returns a list containing frame-by-frame values

htmlPlots

if TRUE, saves an html file with clickable plots

verbose

if TRUE, reports progress and estimated time left

maxDur

maximum allowed duration of a single sound, s (longer sounds are split)

logSpec

if TRUE, the spectrogram is log-transformed prior to taking 2D FFT

windowLength

length of FFT window, ms

step

you can override overlap by specifying FFT step, ms

overlap

overlap between successive FFT frames, %

wn

window type: gaussian, hanning, hamming, bartlett, rectangular, blackman, flattop

zp

window length after zero padding, points

power

raise modulation spectrum to this power (eg power = 2 for ^2, or "power spectrum")

roughRange

the range of temporal modulation frequencies that constitute the "roughness" zone, Hz

plot

if TRUE, produces a spectrogram with pitch contour overlaid

savePlots

if TRUE, saves plots as .png files

logWarp

the base of log for warping the modulation spectrum (ie log2 if logWarp = 2); set to NULL or NA if you don't want to log-warp

quantiles

labeled contour values, % (e.g., "50" marks regions that contain 50% of the sum total of the entire modulation spectrum)

kernelSize

the size of Gaussian kernel used for smoothing (1 = no smoothing)

kernelSD

the SD of Gaussian kernel used for smoothing, relative to its size

colorTheme

black and white ('bw'), as in seewave package ('seewave'), or any palette from palette such as 'heat.colors', 'cm.colors', etc

xlab

plotting parameters

ylab

plotting parameters

width

parameters passed to png if the plot is saved

height

parameters passed to png if the plot is saved

units

parameters passed to png if the plot is saved

res

parameters passed to png if the plot is saved

...

other graphical parameters passed to spectrogram

Value

If summary is TRUE, returns a dataframe with just the roughness measure per audio file. If summary is FALSE, returns a list with the actual modulation spectra.

Examples

Run this code
# NOT RUN {
ms = modulationSpectrumFolder('~/Downloads/temp', savePlots = TRUE, kernelSize = 15)
# }

Run the code above in your browser using DataLab