excess_attenuation() measures excess attenuation in sounds
referenced in an extended selection table. Excess attenuation is the
amplitude loss of a sound in excess of that due to spherical spreading
(observed attenuation - expected attenuation).
Arguments
- X
The output of
set_reference_sounds(), an object of classdata.frame,selection_table, orextended_selection_table(the last 2 classes are created bywarbleR::selection_table()from the warbleR package) with the test sound files' annotations. Must contain the following columns: 1)sound.files: name of the.wavfiles, 2)selec: unique selection identifier (within a sound file), 3)start: start time and 4)end: end time of selections, 5)bottom.freq: low frequency for bandpass, 6)top.freq: high frequency for bandpass, 7)sound.id: ID of sounds used to identify counterparts across distances, and 8)reference: identity of sounds to be used as reference for each test sound (row). Seeset_reference_sounds()for more details on the structure ofX.- cores
Numeric vector of length 1. Controls whether parallel computing is applied by specifying the number of cores to be used. Default
1(i.e. no parallel computing). Can be set globally for the current R session via the"mc.cores"option (seeoptions()).- pb
Logical argument to control if progress bar is shown. Default
TRUE. Can be set globally for the current R session via the"pb"option (seeoptions()).- hop.size
Numeric vector of length 1 specifying the time window duration (in ms). Default
1ms, which is equivalent to ~45wlfor a 44.1 kHz sampling rate. Ignored ifwlis supplied. Can be set globally for the current R session via the"hop.size"option (seeoptions()).- wl
Numeric vector of length 1 specifying the window length of the spectrogram. Default
NULL. If supplied,hop.sizeis ignored. Note that lower values will increase time resolution, which is more important for amplitude calculations.- ovlp
Numeric vector of length 1 specifying the percentage of overlap between two consecutive windows, as in
seewave::spectro(). Default50. Only used for bandpass filtering. Can be set globally for the current R session via the"ovlp"option (seeoptions()).- 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 thebottom.freqandtop.freqfor each sound as the bandpass range.- path
Character string containing the directory path where the sound files are found. Only needed when
Xis 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 (seeoptions()).
Value
Object X with an additional column, excess.attenuation,
containing the computed excess attenuation values (in dB).
Details
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, representing power loss due to 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("reference signal") / rms("test signal"))) - (-20 * log10("reference distance" / "test 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 belong to the same category (e.g. song-types). The function
will then compare each sound type to the corresponding reference
sound. NAs will be returned if one of the envelopes is completely
flat (e.g. no variation in amplitude).
References
Araya-Salas, M., Grabarczyk, E. E., Quiroz-Oliva, M., Garcia-Rodriguez, A., & Rico-Guevara, A. (2025). Quantifying degradation in animal acoustic signals with the R package baRulho. Methods in Ecology and Evolution, 00, 1-12. https://doi.org/10.1111/2041-210X.14481
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.
See also
spcc() and envelope_correlation(), for other
degradation metrics in the time/frequency domain.
Author
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
Examples
{
# 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)
}