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.
modulationSpectrumFolder(
myfolder,
summary = TRUE,
htmlPlots = TRUE,
verbose = TRUE,
maxDur = 5,
logSpec = FALSE,
windowLength = 25,
step = NULL,
overlap = 80,
wn = "hamming",
zp = 0,
power = 1,
roughRange = c(30, 150),
plot = FALSE,
savePlots = FALSE,
logWarp = NA,
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,
...
)
full path to target folder
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
if TRUE, saves an html file with clickable plots
if TRUE, reports progress and estimated time left
maximum allowed duration of a single sound, s (longer sounds are split)
if TRUE, the spectrogram is log-transformed prior to taking 2D FFT
length of FFT window, ms
you can override overlap
by specifying FFT step, ms
overlap between successive FFT frames, %
window type: gaussian, hanning, hamming, bartlett, rectangular, blackman, flattop
window length after zero padding, points
raise modulation spectrum to this power (eg power = 2 for ^2, or "power spectrum")
the range of temporal modulation frequencies that constitute the "roughness" zone, Hz
if TRUE, produces a spectrogram with pitch contour overlaid
if TRUE, saves plots as .png files
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
labeled contour values, % (e.g., "50" marks regions that contain 50% of the sum total of the entire modulation spectrum)
the size of Gaussian kernel used for smoothing (1 = no smoothing)
the SD of Gaussian kernel used for smoothing, relative to its size
black and white ('bw'), as in seewave package ('seewave'),
or any palette from palette
such as 'heat.colors',
'cm.colors', etc
plotting parameters
plotting parameters
parameters passed to
png
if the plot is saved
parameters passed to
png
if the plot is saved
parameters passed to
png
if the plot is saved
parameters passed to
png
if the plot is saved
other graphical parameters passed to spectrogram
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.
# NOT RUN {
ms = modulationSpectrumFolder('~/Downloads/temp', savePlots = TRUE,
kernelSize = 15)
# }
Run the code above in your browser using DataLab