View source: R/modulationSpectrum_utilities.R
| plotMS | R Documentation |
Plots a single modulation spectrum returned by
modulationSpectrum. The result is the same as the plot produced
by modulationSpectrum, but calling plotMS is handy for
processed modulation spectra - for instance, for plotting the difference
between the modulation spectra of two sounds or groups of sounds.
plotMS(
ms,
X = as.numeric(colnames(ms)),
Y = as.numeric(rownames(ms)),
quantiles = c(0.5, 0.8, 0.9),
colorTheme = "bw",
col = NULL,
logWarpX = NULL,
logWarpY = NULL,
main = NULL,
xlab = "Hz",
ylab = "1/kHz",
xlim = NULL,
ylim = NULL,
audio = NULL,
extraY = TRUE,
...
)
ms |
modulation spectrum - a matrix with temporal modulation in columns
and spectral modulation in rows, as returned by
|
X, Y |
colnames and rownames of |
quantiles |
numeric vector of cumulative contours in (0, 1). For
example, |
colorTheme |
plot color theme |
col |
custom color palette; if supplied, overrides |
logWarpX, logWarpY |
numeric vector of length 2: |
main, xlab, ylab, xlim, ylim |
graphical parameters |
audio |
(internal) a list of audio attributes |
extraY |
if TRUE, another Y-axis is plotted on the right showing 1 / (Y-axis value) as a frequency in Hz (assuming that ms is derived from an ordinary STFT with linearly spaced frequency bins) |
... |
other graphical parameters passed on to
|
Does not return anything, just plots the MS.
ms1 = modulationSpectrum(runif(4000), samplingRate = 16000, plot = TRUE)
plotMS(ms1$detailed$processed) # identical to above
# compare two modulation spectra
ms2 = modulationSpectrum(soundgen(sylLen = 100, addSilence = 0),
samplingRate = 16000)
# ensure the two matrices have the same dimensions
ms2_resized = soundgen:::interpolMatrix(ms2$detailed$original,
nr = nrow(ms1$detailed$original), nc = ncol(ms1$detailed$original))
# plot the difference
plotMS(log(ms1$detailed$original / ms2_resized), quantiles = NULL,
col = colorRampPalette(c('blue', 'yellow')) (50))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.