multi_DTW {warbleR} | R Documentation |
A wrapper on dtwDist
for comparing multivariate contours
Description
multi_DTW
is a wrapper on dtwDist
that simplify applying dynamic time warping on multivariate contours.
Usage
multi_DTW(
ts.df1 = NULL,
ts.df2 = NULL,
pb = TRUE,
parallel = 1,
window.type = "none",
open.end = FALSE,
scale = FALSE,
dist.mat = TRUE,
...
)
Arguments
ts.df1 |
Optional. Data frame with frequency contour time series of signals to be compared. |
ts.df2 |
Optional. Data frame with frequency contour time series of signals to be compared. |
pb |
Logical argument to control progress bar. Default is |
parallel |
Numeric. Controls whether parallel computing is applied. It specifies the number of cores to be used. Default is 1 (i.e. no parallel computing). Not available in Windows OS. |
window.type |
|
open.end |
|
scale |
Logical. If |
dist.mat |
Logical controlling whether a distance matrix ( |
... |
Additional arguments to be passed to |
Details
This function extracts the dominant frequency values as a time series and
then calculates the pairwise acoustic dissimilarity using dynamic time warping.
The function uses the approx
function to interpolate values between dominant
frequency measures. If 'img' is TRUE
the function also produces image files
with the spectrograms of the signals listed in the input data frame showing the
location of the dominant frequencies.
Value
A matrix with the pairwise dissimilarity values. If img is
FALSE
it also produces image files with the spectrograms of the signals listed in the
input data frame showing the location of the dominant frequencies.
Author(s)
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
References
Araya-Salas, M., & Smith-Vidaurre, G. (2017). warbleR: An R package to streamline analysis of animal acoustic signals. Methods in Ecology and Evolution, 8(2), 184-191.
See Also
Other spectrogram creators:
color_spectro()
,
freq_DTW()
,
phylo_spectro()
,
snr_spectrograms()
,
spectrograms()
,
track_freq_contour()
Examples
## Not run:
# load data
data(list = c("Phae.long1", "Phae.long2", "Phae.long3", "Phae.long4", "lbh_selec_table"))
writeWave(Phae.long1, file.path(tempdir(), "Phae.long1.wav")) # save sound files
writeWave(Phae.long2, file.path(tempdir(), "Phae.long2.wav"))
writeWave(Phae.long3, file.path(tempdir(), "Phae.long3.wav"))
writeWave(Phae.long4, file.path(tempdir(), "Phae.long4.wav"))
# measure
df <- freq_ts(X = lbh_selec_table, threshold = 10, img = FALSE, path = tempdir())
se <- freq_ts(X = lbh_selec_table, threshold = 10, img = FALSE, path = tempdir(), type = "entropy")
# run function
multi_DTW(df, se)
## End(Not run)