multi_DTW is a wrapper on dtwDist that simplify applying dynamic time warping on multivariate contours.
multi_DTW(ts.df1 = NULL, ts.df2 = NULL, pb = TRUE, parallel = 1, window.type = "none", open.end = FALSE, scale = FALSE, dist.mat = TRUE, ...)
| 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 |
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.
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.
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.
specreator for creating spectrograms from selections,
snrspecs for creating spectrograms to
optimize noise margins used in sig2noise and dfts, ffts, ffDTW for frequency contour overlaid spectrograms.
blog post on DTW similarity
Other spectrogram creators:
color.spectro(),
dfDTW(),
dfts(),
ffDTW(),
ffts(),
phylo_spectro(),
snrspecs(),
sp.en.ts(),
specreator(),
trackfreqs()
if (FALSE) { #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 <- df_ts(X = lbh_selec_table, threshold = 10, img = FALSE, path = tempdir()) se <- se_ts(X = lbh_selec_table, threshold = 10, img = FALSE, path = tempdir()) # run function multi_DTW(df, se) }