S5. Additional (Matlab) ‐ Acoustic audits - ashleyblawas/respdetect GitHub Wiki

For DTAGs: If you choose to do so, the R script respdetect_workup.rmd includes two sections for validating breath detections during logging with acoustic audits. The first section of this R script randomly samples logging intervals for acoustic auditing. This will produce a dataframe called logs_to_audit. Once you have created this dataframe you should use either Step S5a. or S5b. to conduct an acoustic audit for respirations of each of the logging periods contained in the aforementioned dataframe.

Note: It might be the case that you can't hear any breaths because it of surfacing splashing... that is okay, and you should only audit breaths that can clearly distinguish.

Once you have audited these sections, you will have many files ending in _acousticaud.txt in your audit folder in your data path. If any of these are of size 0 (i.e. there were no audited breaths for that tag), go ahead and remove them from that folder or delete them. R will get confused if it tries to read in an empty file.

Now you can run the second section in R for the acoustic auditing which will match up your acoustic audits with the closest detected breath by the breath detector. It will output a plot with the time differences between the acoustic audits and detections which can be used to determine the accuracy of the detectors for this random sample.