specreator
creates spectrograms of signals selected by manualoc
or autodetec
.
specreator(X, wl = 512, flim = c(0, 22), wn = "hanning", pal
= reverse.gray.colors.2, ovlp = 70, inner.mar = c(5, 4, 4, 2), outer.mar =
c(0, 0, 0, 0), picsize = 1, res = 100, cexlab = 1, title = TRUE,
propwidth = FALSE, xl = 1, osci = FALSE, gr = FALSE, sc = FALSE, line = TRUE,
mar = 0.05, it = "jpeg", parallel = 1, path = NULL, pb = TRUE, fast.spec = FALSE, ...)
A numeric vector of length 1 specifying the window length of the spectrogram, default is 512.
A numeric vector of length 2 for the frequency limit (in kHz) of
the spectrogram, as in spectro
. Default is c(0, 22).
Character vector of length 1 specifying window name. Default is
"hanning". See function ftwindow
for more options.
A color palette function to be used to assign colors in the
plot, as in spectro
. Default is reverse.gray.colors.2.
Numeric vector of length 1 specifying the percent overlap between two
consecutive windows, as in spectro
. Default is 70.
Numeric vector with 4 elements, default is c(5,4,4,2).
Specifies number of lines in inner plot margins where axis labels fall,
with form c(bottom, left, top, right). See par
.
Numeric vector with 4 elements, default is c(0,0,0,0).
Specifies number of lines in outer plot margins beyond axis labels, with
form c(bottom, left, top, right). See par
.
Numeric argument of length 1. Controls relative size of
spectrogram. Default is 1. Ignored when propwidth is TRUE
.
Numeric argument of length 1. Controls image resolution. Default is 100 (faster) although 300 - 400 is recommended for publication/ presentation quality.
Numeric vector of length 1 specifying the relative size of axis
labels. See spectro
.
Logical argument to add a title to individual spectrograms.
Default is TRUE
.
Logical argument to scale the width of spectrogram
proportionally to duration of the selection. Default is FALSE
.
Numeric vector of length 1. A constant by which to scale
spectrogram width if propwidth = TRUE
. Default is 1.
Logical argument to add an oscillogram underneath spectrogram, as
in spectro
. Default is FALSE
.
Logical argument to add grid to spectrogram. Default is FALSE
.
Logical argument to add amplitude scale to spectrogram, default is
FALSE
.
Logical argument to add red lines at start and end times of selection
(or box if low.f and high.f columns are provided). Default is TRUE
.
Numeric vector of length 1. Specifies the margins adjacent to the start and end points of selections, dealineating spectrogram limits. Default is 0.05.
A character vector of length 1 giving the image type to be used. Currently only "tiff" and "jpeg" are admitted. Default is "jpeg".
Numeric. Controls whether parallel computing is applied. It specifies the number of cores to be used. Default is 1 (i.e. no parallel computing).
Character string containing the directory path where the sound files are located.
If NULL
(default) then the current working directory is used.
Logical argument to control progress bar. Default is TRUE
. Note that progress bar is only used
when parallel = 1.
Logical. If TRUE
then image function is used internally to create spectrograms, which substantially
increases performance (much faster), although some options become unavailable, as collevels, and sc (amplitude scale).
This option is indicated for signals with high background noise levels. Palette colors gray.1
, gray.2
,
gray.3
, topo.1
and rainbow.1
(which should be imported from the package monitoR) seem
to work better with 'fast' spectograms. Palette colors gray.1
, gray.2
,
gray.3
offer
decreasing darkness levels. THIS IS STILL BEING TESTED.
Additional arguments to be passed to the internal spectrogram creating function for customizing graphical output. The function is a modified version of spectro
, so it takes the same arguments.
Image files containing spectrograms of the signals listed in the input data frame.
This function provides access to bath process of (a modified version of) the spectro
function from the 'seewave' package. The function creates spectrograms for visualization of vocalizations.
Setting inner.mar to c(4,4.5,2,1) and outer.mar to c(4,2,2,1) works well when picsize = 2 or 3.
Title font size, inner.mar and outer.mar (from mar and oma) don't work well when osci or sc = TRUE,
this may take some optimization by the user. Setting 'fast' argument to TRUE significantly increases speed, although
some options become unavailable, as collevels, and sc (amplitude scale). This option is indicated for signals with
high background noise levels.
trackfreqs
for creating spectrograms to visualize
frequency measurements by specan
, snrspecs
for
creating spectrograms to optimize noise margins used in sig2noise
Other spectrogram.creators: dfDTW
,
dfts
, ffDTW
,
ffts
, snrspecs
,
sp.en.ts
, trackfreqs
# NOT RUN {
# First set empty folder
setwd(tempdir())
data(list = c("Phae.long1", "Phae.long2","selec.table"))
writeWave(Phae.long1, "Phae.long1.wav") #save sound files
writeWave(Phae.long2, "Phae.long2.wav")
# make spectrograms
specreator(selec.table, flim = c(0, 11), res = 300, mar = 0.05, wl = 300)
#' #check this folder!!
getwd()
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab