View source: R/excess_attenuation.R
excess_attenuation | R Documentation |
excess_attenuation
measures excess attenuation in sounds referenced in an extended selection table.
excess_attenuation(
X,
cores = getOption("mc.cores", 1),
pb = getOption("pb", TRUE),
hop.size = getOption("hop.size", 1),
wl = getOption("wl", NULL),
ovlp = getOption("ovlp", 50),
bp = "freq.range",
path = getOption("sound.files.path", ".")
)
X |
The output of |
cores |
Numeric vector of length 1. Controls whether parallel computing is applied by specifying the number of cores to be used. Default is 1 (i.e. no parallel computing). Can be set globally for the current R session via the "mc.cores" option (see |
pb |
Logical argument to control if progress bar is shown. Default is |
hop.size |
A numeric vector of length 1 specifying the time window duration (in ms). Default is 1 ms, which is equivalent to ~45 wl for a 44.1 kHz sampling rate. Ignored if 'wl' is supplied. |
wl |
A numeric vector of length 1 specifying the window length of the spectrogram, default
is |
ovlp |
Numeric vector of length 1 specifying the percentage of overlap between two
consecutive windows, as in |
bp |
Numeric vector of length 2 giving the lower and upper limits of a frequency bandpass filter (in kHz). Alternatively, when set to 'freq.range' (default), the function will use the 'bottom.freq' and 'top.freq' for each sound as the bandpass range. |
path |
Character string containing the directory path where the sound files are found. Only needed when 'X' is not an extended selection table. If not supplied the current working directory is used. Can be set globally for the current R session via the "sound.files.path" option (see |
Excess attenuation is the amplitude loss of a sound in excess due to spherical spreading (observed attenuation - expected attenuation). With every doubling of distance, sounds attenuate with a 6 dB loss of amplitude (Morton, 1975; Marten & Marler, 1977). Any additional loss of amplitude results in energy loss in excess of that expected to occur with distance via spherical spreading. So it represents power loss due to additional factors like vegetation or atmospheric conditions (Wiley & Richards, 1978). It accounts for attenuation from additional factors such as:
Ground absorption
: sound energy can be absorbed by the ground, especially in environments like forests with soft or uneven terrain.
Vegetation and obstacles
: trees, shrubs, and other obstacles can absorb or scatter sound energy, reducing the sound level more than geometric spreading alone would predict.
Air absorption
: as sound travels through air, it loses energy due to air molecules absorbing the sound waves, and this effect becomes more pronounced over longer distances.
Wind and temperature gradients
: These environmental factors can cause sound waves to bend or refract.
Excess attenuation is computed as -20 * log10(rms("test signal") / rms("reference signal"))) - (20 * log10(1 / "distance")
in which 'rms(..)' represents the root mean square of an amplitude envelope. Low values indicate little additional attenuation. The goal of the function is to measure the excess attenuation on sounds in which a reference playback has been re-recorded at increasing distances. The 'sound.id' column must be used to indicate which sounds belonging to the same category (e.g. song-types). The function will then compare each sound type to the corresponding reference sound. Two approaches for computing excess attenuation are provided (see 'type' argument). NAs will be returned if one of the envelopes is completely flat (e.g. no variation in amplitude).
Object 'X' with an additional column, 'excess.attenuation', containing the computed excess attenuation values (in dB).
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
Araya-Salas M., E. Grabarczyk, M. Quiroz-Oliva, A. Garcia-Rodriguez, A. Rico-Guevara. (2023), baRulho: an R package to quantify degradation in animal acoustic signals .bioRxiv 2023.11.22.568305.
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.
Dabelsteen, T., & Mathevon, N. (2002). Why do songbirds sing intensively at dawn?. Acta ethologica, 4(2), 65-72.
Darden, SK, Pedersen SB, Larsen ON, & Dabelsteen T. (2008). Sound transmission at ground level in a short-grass prairie habitat and its implications for long-range communication in the swift fox *Vulpes velox*. The Journal of the Acoustical Society of America, 124(2), 758-766.
Marten K, & Marler P. (1977). Sound transmission and its significance for animal vocalization. Behavioral Ecology and Sociobiology, 2(3), 271-290.
Morton ES. (1975). Ecological sources of selection on avian sounds. The American Naturalist, 109(965), 17-34.
Wiley, R., & Richards, D. G. (1978). Physical constraints on acoustic communication in the atmosphere: implications for the evolution of animal vocalizations. Behavioral Ecology and Sociobiology, 3(1), 69-94.
spcc
; envelope_correlation
{
# load example data
data("test_sounds_est")
# using method 1
# add reference to X
X <- set_reference_sounds(X = test_sounds_est)
excess_attenuation(X = X)
# using method 2
X <- set_reference_sounds(X = test_sounds_est, method = 2)
# excess_attenuation(X = X)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.