Compare signals from selection tables to a set of templates using cross-correlation

I got the following question about cross-correlation: “We would like to compare every call within a selection table to a template of each owl, and get peak correlation coefficients on each call separately” One way to do this would be putting the unidentified and template signals together into a single selection table, and then running cross-correlation. However, this will also compare all unidentified signals against each other, which can be very inefficient. [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]

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]

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]

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]

Song similarity using dynamic time warping

Here I show how to use the dfDTW function in warbleR to compare acoustics signals using dynamic time warping (DTW). First load these packages (if not installed the code will install it): x<-c("vegan", "warbleR") A <- lapply(x, function(y) { if(!y %in% installed.packages()[,"Package"]) install.packages(y) require(y, character.only = T) }) and load example data from warbleR # optional, save it in a temporal folder # setwd(tempdir()) data(list = c( "Phae.long1", "Phae.long2","Phae.long3", "Phae.long4","selec.table")) writeWave(Phae. [Read More]

Using your own frequency contours on DTW

I got the following question about dynamic time warping on frequency contours: “what I am looking for is to use ffDTW on a file in which I have a column for the filename and then 20 pitch measurements for each of 10000 files (e.g. 10000 rows). Do you have suggestions?” There is a workaround in warbleR to do that: The function dfDTW() has the argument ts.df (for time series data frame) that allows to input your own frequency contours (or any other sequences of values taken along the signals). [Read More]

Working with higher structural levels in vocal signals

Animal vocalizations can be hierarchically structured: elements group together in syllables, syllables in songs, songs in bouts and so on. Many important biological patterns of vocal variation are better described at higher structural levels, so we are often interested in characterizing vocalizations at those levels. There are several tools in warbleR to explore and measure features above the element level. For simplicity, any level above ’elements’ will be refered to as ‘songs’ in this post as well as in the warbleR functions described here. [Read More]