Soundscape can be defined as the collection of sounds that are recorded from a particular landscape. Soundscapes typically can have three main components: biophony, geophony and anthropohony. Depending on the type of landscape and weather conditions certain components can be the predominant ones.
There are two approaches for studying soundscapes: 1) focusing on the complete soundscape without getting to know the identity of each species, 2) identifying each species in its sound signal. For this example, the first approach was chosen to analyse the data.
In this approach there are several indices you can calculate from the spectrogram. Each one focusing on different aspects of the heterogeneity of the spectral signals. Here is a brief list of the possible indices that can be calculated in R.
Acoustic complexity index.
Acoustic entropy index.
Acoustic richness index.
Number of frequency peaks.
Amplitude index.
Normalized difference soundscape index.
Spectral entropy.
Temporal entropy.
Acoustic diversity index.
Acoustic eveness.
Spectrograms
Spectrograms are visual representations of recordings that can help identify the frequency at which sounds ocurr, as well as temporal patterns. For example, this is a spectrogram showing the sounds of a recording in a tropical rainforest. Please notice that the x-axis represents time in the recording, the y-axis, the dominant frequency in each sound and the color represents the instensity (or magnitude) of the sound in dB.
Wordcloud of my publications.
The code to construct the previous spectrogram is the following
Code to perform analysis
For this example, the acoustic diversity index will be calculated. Although the soundscape package contains a function that enables computing certain indices in parallel, a new function to do exactly that with any of the previous indices will be made.
First, we need to load the required packages and define some variables
Next, we should locate the files that are going to be analysed.
Then, we need to define the functions we are going to use.
In this case, a filter function will be used to filter the sounds.
Then a function is going to be made to calculate the alpha diversity indices of interest. In this case, only the acoustic diversity will be calculated.
And finally, the function that will include the previous two functions: filtering and calculating the alpha diversity indices.
Then we can make the process in parallel and export a csv with the calculated indices, one for each file.