Acoustic space scatter plot

Someone asked me for the code to make figure 3 in the Methods in Ecology and Evolution paper describing warbleR. So, here it is. The figure was made in part by my collaborator Grace Smith-Vidaurre, so thanks to Grace for sharing. The figure shows the grouping of long-billed hermit songs in the acoustic space based on similarity of dominant frequency contours. Similarity was assessed using dynamic time warping. The scatterplot is based on the two axes from a classic multidimensional scaling. [Read More]

Creating song catalogs

When looking at geographic variation of songs we usually want to compare the spectrograms from different individuals and sites. This can be challenging when working with large numbers of signals, individuals and/or sites. The new warbleR function catalog aims to simplify this task. This is how it works: The function plots a matrix of spectrograms from signals listed in a selection table (a data frame similar to the example data frame selec. [Read More]

Choosing the right method for measuring acoustic signal structure

Bioacoustic research relies on quantifying the structure of acoustic` signals and comparing that structure across behavioral/ecological contexts, groups or species. However, measuring signal structure in a way that fully accounts for the variation in the signals could be a tricky task. Some of the differences that are apparent by visual inspection of spectrograms might not be picked up by some analyses. Hence, choosing the most appropriate analytical approach is a critical step. [Read More]

Signal detection with cross-correlation using monitoR

Here I show how to detect signals with cross-correlation using the very cool package monitoR. This package aims to facilitate acoustic template detection. The code here is similar but much less detailed than the quick start vignette of the monitoR package, so I encourage to look at the vignette if you want to learn more about it. The package monitoR runs cross-correlation across sound files to search for the signals using previously defined templates. [Read More]

Creating dynamic spectrograms (videos)

This code creates a video with a spectrogram scrolling from right to left. The spectrogram is synchronized with the audio. This is done by creating single image files for each of the movie frames and then putting them together in .mp4 video format. You will need the ffmpeg UNIX application to be able to run the code (only works for OSX and Linux). First load the warbleR package require("warbleR") Download and read the example sound file (long-billed hermit song) [Read More]

Download a single recording for each species in a country from Xeno-Canto

A warbleR user asks if “there is any method for downloading from xeno canto a SINGLE individual of each species in Costa Rica”. This can be done by 1) downloading the metadata of all recordings in a given site (in this case Costa Rica) using the querxc function from the package warbleR (which searches and downloads recordings from Xeno-Canto), 2) filtering the metadata to have only one recording per species, and 3) input the filtered metadata back into querxcto download the selected recordings. [Read More]

Evaluating group acoustic signatures using cross-correlation

Social learning is often diagnosed by mapping the geographic variation of behavior. Behavioral variation at a small geographical scale that shows both sharp differences among localities and consistency within localities is indicative of social learning of local traditions. This pattern translates into a pretty straightforward statistical hypothesis: the behavior is more similar within than between groups (although absence of this pattern doesn’t necessarily imply a lack of learning!). In other words, if there is social learning going on, we can expect a group level signature. [Read More]

Fixing selections manually

This short post shows how to use the seltailor function to adjust selection frequency and time ‘coordinates’ in an interactive and iterative manner. To be able to run the code you need warbleR 1.1.9 or higher, which hasn’t been released on CRAN and it’s only available on github. It can be installed using the devtools package as follows # install devtools and monitor if are not yet installed # install devtools if is not yet installed if(! [Read More]

Frequency range detection from spectrum

We are often interested in getting the frequency range of acoustic signals, either because we have specific predictions about its variation or simply because we want to measure other stuff within that range. Measuring frequency range is typically done by drawing boxes in Raven/Avisoft/Syrinx. An alternative way, and potentially less subjective, is to infer the range from the energy distribution in the frequency domain applying amplitude thresholds on spectrums. I have added two new functions to warbleR that do exactly that: [Read More]

Pdf files with spectrograms of full recordings

The warbleR function lspec produces image files with spectrograms of whole recordings split into multiple rows. For a long recording several image files will be produced, which could be inconvenient when dealing with many long recordings. I recently added a new function lspec2pdf that combines lspec images in .jpeg format into a single pdf file (available in warbleR 1.1.5 or higher). You need warbleR version 1.1.5 or higher to be able to run the code (currently you have to download it from github using the package devtools). [Read More]