baRulho R package
Quantifying habitat-induced degradation of animal sounds
Marcelo Araya-Salas (University of Costa Rica) Erin E. Grabarczyk (Valdosta State University) Marcos Quiroz-Oliva (University of Costa Rica) Adrián García-Rodríguez (University of Vienna) Alejandro Rico-Guevara (University of Washington)
Sound degradation and signal evolution
Sound degradation experiments
Usual steps:
Difficulties have likely contributed to their limited implementation
Conducting sound transmission experiments, however, can be challenging. Several steps are involved, such as careful formatting and manipulation of audio files, broadcasting and re-recording study signals in natural settings, annotation of re-recorded files, and quantification of degradation measures. These difficulties have likely contributed to the limited implementation of such experiments in animal communication research.
Sound degradation experiments
Usual steps:
R package baRulho
Facilitate implementing sound degradation experiments:
Here, we introduce the R package ‘baRulho’ (Portuguese for ‘noise’), which is intended to facilitate animal sound transmission experiments and their subsequent analysis. The package offers tools to help researchers at each step of the process, from generating synthesized sounds and creating playback sound files, to streamlining annotation and measurement of sound degradation in re-recorded signals.
Objectives
1. Showcase study: effects of habitat and signal structure on transmission using synthesized sounds
2. Compare baRulho
and Sigpro
We highlight package features with a case study testing the effects of habitat and signal structure on transmission properties using synthesized sounds. In addition, as proof of concept, we compared baRulho’s output to that of Sigpro (Pedersen 1998), the most commonly used software for quantifying sound degradation.
Synthesize animal-like sounds
Varying features: frequency, duration, amplitude and frequency modulation
synth_est <- synth_sounds (frequencies = c (1 , 2 , 3 ),
durations = c (0.1 , 0.2 ),
fm = TRUE , am = TRUE )
master_annotations <- master_sound_file (X = synth_data)
Automated alignment of re-recorded files
markers_position <- find_markers (X = master_annotations,
test.files = "path_to_files" )
markers <- align_test_files (X = master_annotations,
Y = markers_position)
Automated alignment of re-recorded files
markers_position <- find_markers (X = master_annotations,
test.files = "path_to_files" )
markers <- align_test_files (X = master_annotations,
Y = markers_position)
Video
Check alignment
plot_aligned_sounds (test_sounds_est)
Visualize degradation
plot_degradation (test_sounds_est)
Visualize degradation
plot_blur_ratio (test_sounds_est)
Quantify degradation
8 degradation measures:
- Attenuation
- Reverberation
- Distortion
degrad <- blur_ratio (test_sounds_est) |>
envelope_correlation (test_sounds_est) |>
excess_attenuation (test_sounds_est) |>
signal_to_noise_ratio (test_sounds_est, mar = 0.01 ) |>
tail_to_signal_ratio (test_sounds_est, mar = 0.01 ) |>
cross_correlation (test_sounds_est) |>
spectrum_blur_ratio (test_sounds_est) |>
spectrum_correlation (test_sounds_est)
Degradation, habitat and acoustic structure
degradation metric ~ habitat + freq + duration + am + fm
Degradation, habitat and acoustic structure
degradation metric ~ habitat + freq + duration + am + fm
baRulho vs Sigpro
Sigpro : 861 min
baRulho : 7 min (~120x faster)
R package baRulho
Takeaways
Adequate quantification
Good performance
Expanded toolkit
Acknowledgements
Centro de Investigación en Neurociencias, Universidad de Costa Rica
Lab Biocomputines, Universidad de Costa Rica
Bioacustics in R Workshop, Instituto de Biología, Universidad Nacional Autónoma de México (2019)
Mariano Araya & Luis Sandoval, PhD
Packages seewave
and tuneR