Description Usage Arguments Value Author(s) See Also Examples
View source: R/standard.spg.image.R
makes a black-and-white bitmap with darkness denoting amplitude, with lots of user control over appearance. The output file is in PNG format
1 | standard.spg.image(spg, path = "default.png", amplitude.threshold = 0, time.offset = 0, ...)
|
spg |
a spectrogram object |
path |
the location of the image file that will be produced |
amplitude.threshold |
any amplitude less than this threshold will be ignored |
time.offset |
you may want to shift the time axis to match up with other files |
... |
further arguments to plot.spg |
none
Benjamin N. Taft ben.taft@landmarkacoustics.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (spg, path = "default.png", amplitude.threshold = 0,
time.offset = 0, ...)
{
if (is(spg) == "spg") {
png(path, 5 * 180, 3 * 180, pointsize = 10, res = 180)
par(mar = c(10, 10, 2, 2)/3, mgp = 2 * c(3, 1, 0)/3)
temp <- -spg
temp[temp > amplitude.threshold] <- amplitude.threshold
image(attr(spg, "time"), attr(spg, "frequency")/1000,
temp, col = gray.colors(512, 0, 1), xlab = "Time (s)",
xlim = c(0, 3) + time.offset, ylab = "Frequency (kHz)",
ylim = c(0, 10), ...)
dev.off()
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.