{
# load example data
data("lbh1", "lbh_reference")
# save sound files
tuneR::writeWave(lbh1, file.path(tempdir(), "lbh1.wav"))
# template for the first sound file in 'lbh_reference'
templ1 <- lbh_reference[lbh_reference$sound.files == "lbh1.wav" & lbh_reference$selec == 11, ]
# generate template correlations
tc <- template_correlator(
templates = templ1, path = tempdir(),
files = "lbh1.wav"
)
# template detection
td <- template_detector(template.correlations = tc, threshold = 0.35)
# this detection generates 2 split positives
diagnose_detection(
reference = lbh_reference[lbh_reference == "lbh1.wav", ],
detection = td,
solve.ambiguous = FALSE
)
# label detection
ltd <- label_detection(
reference = lbh_reference[lbh_reference == "lbh1.wav", ],
detection = td,
solve.ambiguous = FALSE
)
# now they can be filter to keep the detection with the highest score for each split
ftd <- consensus_detection(ltd, by = "scores")
# splits must be 0
diagnose_detection(
reference = lbh_reference[lbh_reference == "lbh1.wav", ],
detection = ftd,
solve.ambiguous = FALSE
)
}
Run the code above in your browser using DataLab