trackfreqs
creates spectrograms to visualize dominant and fundametal frequency measurements (contours)
of signals selected by manualoc
or autodetec
.trackfreqs(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, bp = c(0, 22), cex = c(0.6, 1),
threshold = 15, contour = "both", col = c("skyblue", "red2"),
pch = c(21, 24), mar = 0.05, lpos = "topright", it = "jpeg", parallel = 1,
path = NULL, img.suffix = NULL, custom.contour = NULL, pb = TRUE, type = "p",
leglab = c("Ffreq", "Dfreq"), col.alpha = 0.6, line = TRUE,
fast.spec = FALSE, ff.method = "seewave", ...)
spectro
. Default is c(0, 22).ftwindow
for more options.spectro
. Default is reverse.gray.colors.2.spectro
. Default is 70.par
.par
.spectro
.TRUE
.FALSE
.spectro
. Default is FALSE
.FALSE
.FALSE
.spectro
.NULL
(default) then the current working directory is used.NULL
.TRUE
. Note that progress bar is only used
when parallel = 1.TRUE
.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.spectro
, so it takes the same arguments.specan
. Frequency measures can be made by the function or input by the
user (see 'custom.contour' argument) Arguments that are accepted by xy.coords and can be
used for 'lpos' are: "bottomright", "bottom", "bottomleft", "left",
"topleft", "top", "topright", "right" and "center". 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. Note that if no amplitude was detected
for a particular time bin, then the image will show a dark dot at the bottom of the time bin.specreator
for creating spectrograms from selections,
snrspecs
for creating spectrograms to
optimize noise margins used in sig2noise
Other spectrogram.creators: dfDTW
,
dfts
, ffDTW
,
ffts
, snrspecs
,
sp.en.ts
, specreator
## Not run: ------------------------------------
# #Set temporary working directory
# setwd(tempdir())
#
# #load data
# data("Cryp.soui")
# writeWave(Cryp.soui, "Cryp.soui.wav") #save sound files
#
# #autodetec location of signals
# ad <- autodetec(threshold = 6, bp = c(1, 3), mindur = 1.2,
# maxdur = 3, img = FALSE, ssmooth = 600, wl = 300, flist = "Cryp.soui.wav")
#
# #track dominant frequency graphs
# trackfreqs(X = ad[!is.na(ad$start),], flim = c(0, 5), ovlp = 90, it = "tiff",
# bp = c(1, 3), contour = "df", wl = 300)
#
# #using users frequency data (custom.contour argument)
# #first get contours using dfts
# df <- dfts(X = ad[!is.na(ad$start),], flim = c(0, 5), ovlp = 90, img = FALSE,
# bp = c(1, 3), wl = 300)
#
# # now input the dfts output into trackfreqs
# trackfreqs(X = ad[!is.na(ad$start),], custom.contour = df ,flim = c(0, 5), ovlp = 90, it = "tiff")
#
# # Check this folder
# getwd()
#
# #track both frequencies
# trackfreqs(X = ad[!is.na(ad$start),], flim = c(0, 5), ovlp = 90, it = "tiff",
# bp = c(1, 3), contour = "both", wl = 300)
#
## ---------------------------------------------
Run the code above in your browser using DataLab