dtwDist
for comparing multivariate contoursmulti_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, ...)
Optional. Data frame with frequency contour time series of signals to be compared.
Optional. Data frame with frequency contour time series of signals to be compared.
Logical argument to control progress bar. Default is TRUE
. Note that progress bar is only used
when parallel = 1.
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.
Logical. If TRUE
dominant frequency values are z-transformed using the scale
function, which "ignores" differences in absolute frequencies between the signals in order to focus the
comparison in the frequency contour, regardless of the pitch of signals. Default is TRUE
.
Logical controlling whether a distance matrix (TRUE
,
default) or a tabular data frame (FALSE
) is returned.
Additional arguments to be passed to trackfreqs
for customizing
graphical output.
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()
# 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 <- 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)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab