find_peaks | R Documentation |
find_peaks
find peaks in cross-correlation scores from cross_correlation
find_peaks(xc.output, parallel = 1, cutoff = 0.4, path = NULL, pb = TRUE,
max.peak = FALSE, output = "data.frame")
xc.output |
output of |
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). |
cutoff |
Numeric vector of length 1 with a value between 0 and 1 specifying the correlation cutoff for detecting peaks. Default is 0.4. |
path |
Character string containing the directory path where the sound files are located.
If |
pb |
Logical argument to control progress bar. Default is |
max.peak |
Logical argument to control whether only the peak with the highest correlation value is returned (if TRUE; cutoff will be ignored). Default is |
output |
Character vector of length 1 to determine if only the detected peaks are returned ('cormat') or a list ('list') containing 1) the peaks and 2) a data frame with correlation values at each sliding step for each comparison. The list, which is also of class 'peaks.output', can be used to graphically explore detections using |
This function finds cross-correlation peaks along signals (analogous to findPeaks
).
The function returns a data frame with time and correlation score for the detected peaks.
Marcelo Araya-Salas marcelo.araya@ucr.ac.cr)
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.
H. Khanna, S.L.L. Gaunt & D.A. McCallum (1997). Digital spectrographic cross-correlation: tests of sensitivity. Bioacoustics 7(3): 209-234
auto_detec
, findPeaks
{
# load data
data(list = c("Phae.long4", "Phae.long2", "lbh_selec_table2", "comp_matrix"))
# save sound files
writeWave(Phae.long4, file.path(tempdir(), "Phae.long4.wav"))
writeWave(Phae.long2, file.path(tempdir(), "Phae.long2.wav"))
# run cross-correlation
xc.output <- cross_correlation(
X = lbh_selec_table2, output = "list",
compare.matrix = comp_matrix, path = tempdir()
)
# find peaks
pks <- find_peaks(xc.output = xc.output, path = tempdir())
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.