The bioSNR package is an open-source SONAR equation calculator. The calculator is capable of handling simple to intermediate level acoustic problems associated with bioacoustics and passive acoustic monitoring (PAM) systems.
This document gives quick examples of bioSNR’s capabilities with dB operations.
#Stable - Install package from CRAN
install.packages("bioSNR")
#Unstable - Install package from Github repository
devtools::install_github("MattyD797/bioSNR")
#Attach package namespace to active libraries in Rstudio
library(bioSNR)
The decibel (dB) is the logarithmic ratio between a common metric of sound (e.g., power, intensity, pressure) and its corresponding reference level. No matter the reference chosen, the formula used to calculate dBs remains the same and is adapted from the unit Bell or $Bel=\log_{10}(\frac{Power_2}{Power_1})$. Below are the specific equations for the three common metrics of sound (power, intensity, or pressure, respectively):
$$ dB\:re\:W_{ref}=10\log_{10}(\frac{W}{W_{ref}}) $$ $$ dB\:re\:I_{ref}=10\log_{10}(\frac{I}{I_{ref}}) $$ $$ dB\:re\:P_{ref}=10\log_{10}(\frac{P^2}{P_{ref}^2})\;\; |\;\;dB\:re\:P_{ref}=20\log_{10}(\frac{P}{P_{ref}}) $$
When reporting back dB values, it is important to always label the value with the correct reference level, which is primarily decided upon by the ecosystem the sound value is calculated in (e.g., air, water). The common reference levels that are always IMPORTANT to show are in the table below:
Pressure | Intensity | Power | |
---|---|---|---|
Air | 20 μPa | 1 * 10−12 W/m2 | 1 * 10−12 W |
Water | 1 μPa | 6.7 * 10−19 W/m2 | 6.7 * 10−19 W |
dBs | Pressure | Intensity | Power | ‘Loudness’ |
+3 | 1.41* | 2* | 2* | 1.23* |
+6 | 2* | 4* | 4* | 1.52* |
+10 | 3.16* | 10* | 10* | 2* |
+20 | 10* | 100* | 100* | 4* |
Say you are interested in playing an excerpt from your favorite radio hit both underwater and in air (of course, we don’t recommend this without the right permits!) If you wanted the song to be heard underwater at the same dB level you played it in air, you would need to increase the dB level by 61.5 dBs. This is due to different reference levels and impedances between the two ecosystems. Differences in reference levels account for 26 dB, and differences in impedances account for 35.5 dB, in total amounting to 61.5 dBs.
waterdB − 61.5 = airdB
Simple operations with dBs are performed in three steps: calculating linear values, add/subtract these linear values, and convert back to dB-s (a logarithmic value). We can write out this operation as below:
Since comparing dBs can be more complicated than performing simple operations, the bioSNR package makes adding, subtracting, and averaging relatively simple and streamlined with just a single function.