Learn R Programming

baRulho: quantifying degradation of (animal) sounds

baRulho is intended to facilitate the implementation of (animal) sound transmission experiments, which typically aim to quantify changes in signal structure when transmitted in a given habitat by broadcasting and re-recording animal sounds at increasing distances.

These experiments aim to answer research questions such as:

  • How habitat structure has shaped the transmission properties of animal acoustic signals?
  • Which acoustic features are shaped by selection for improving transmission?
  • Which features are more degraded in different habitats?
  • How far a acoustic signals can be detected?

A common sequence of steps to experimentally test hypotheses related to sound transmission is depicted in the following diagram:

Diagram depicting a typical workflow for a experiment working on signal transmission and degradation. Nodes with black font indicate steps that can be conducted using baRulho functions. Blue nodes denote the functions that can be used at those steps.

 

baRulho offers functions for critical steps in this workflow (those in black, including ‘checks’) that required acoustic data manipulation and analysis.

The main features of the package are:

  • The use of loops to apply tasks through sounds referenced in a selection table (sensu warbleR)
  • The production of image files with graphic representations of sound in time and/or frequency that let users verify acoustic analyses
  • The use of annotation tables as the object format to input acoustic data and annotations and to output results
  • The use of parallelization to distribute tasks among several cores to improve computational efficiency

baRulho builds upon functions and data formats from the warbleR and seewave packages, so some experience with these packages is advised.

Take a look at the vignettes for an overview of the main features of the packages:

Installing baRulho

Install/load the package from CRAN as follows:

# From CRAN would be
# install.packages("baRulho")

# load package
library(baRulho)

It can also be install from R-Universe in this way:

install.packages("baRulho", repos = "https://ropensci.r-universe.dev")
## Installing package into '/home/m/R/x86_64-pc-linux-gnu-library/4.1'
## (as 'lib' is unspecified)

To install the latest developmental version from github you will need the R package remotes:

# install remotes if not installed
if (!requireNamespace("remotes")) {
  install.packages("remotes")
}

# From github
remotes::install_github("ropensci/baRulho")

# load package
library(baRulho)

Further system requirements due to the dependency seewave may be needed. Take a look a this link for instruction on how to install/troubleshoot these external dependencies.

Other packages

The packages seewave and tuneR provide a huge variety of functions for acoustic analysis and manipulation. They mostly work on wave objects already imported into the R environment. The package warbleR provides functions to visualize and measure sounds already referenced in annotation tables, similar to baRulho. The package Rraven facilitates the exchange of data between R and Raven sound analysis software (Cornell Lab of Ornithology) and can be very helpful for incorporating Raven as the annotating tool into acoustic analysis workflow in R. The package ohun works on automated detection of sound events, providing functions to diagnose and optimize detection routines.

Citation

Please cite baRulho as follows:

Araya-Salas, M. (2020), baRulho: quantifying degradation of (animal) acoustic signals in R. R package version 1.0.0.

References

  1. Dabelsteen, T., Larsen, O. N., & Pedersen, S. B. (1993). Habitat-induced degradation of sound signals: Quantifying the effects of communication sounds and bird location on blur ratio, excess attenuation, and signal-to-noise ratio in blackbird song. The Journal of the Acoustical Society of America, 93(4), 2206.

  2. Marten, K., & Marler, P. (1977). Sound transmission and its significance for animal vocalization. Behavioral Ecology and Sociobiology, 2(3), 271-290.

  3. Morton, E. S. (1975). Ecological sources of selection on avian sounds. The American Naturalist, 109(965), 17-34.

Copy Link

Version

Install

install.packages('baRulho')

Monthly Downloads

400

Version

2.1.3

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Marcelo Araya-Salas

Last Published

January 25th, 2025

Functions in baRulho (2.1.3)

blur_ratio

Measure blur ratio in the time domain
signal_to_noise_ratio

Measure attenuation as signal-to-noise ratio
plot_degradation

Save multipanel plots with reference and test sounds
plot_blur_ratio

Plot blur ratio
noise_profile

Measure full spectrum sound noise profiles
plot_aligned_sounds

Plot spectrograms to check test sound files alignment
spcc

Measure spectrographic cross-correlation as a measure of sound distortion
manual_realign

Plot spectrograms to check test sound files alignment
set_reference_sounds

Set reference for test sounds
master_sound_file

Create a master sound file
master_est

Extended selection table of master acoustic data
tail_to_signal_ratio

Measure reverberations as tail-to-signal ratio
test_sounds_est

Extended selection table with re-recorded playbacks
spectrum_blur_ratio

Measure blur ratio in the frequency domain
synth_sounds

Create synthetic sounds
spectrum_correlation

Measure frequency spectrum correlation
envelope_correlation

Measure amplitude envelope correlation
align_test_files

Align test sound files
baRulho-package

baRulho: quantifying acoustic signal degradation
excess_attenuation

Measure excess attenuation
add_noise

Add synthetic noise
attenuation

Estimate attenuation of sound pressure level
detection_distance

Measure detection distance of sound
find_markers

Find acoustic markers on test sound files
auto_realign

Fix small misalignments in the time position test sounds