#' Convert dB to Pascals
#'
#' This function allows you to convert decibels to Pascals. Defaults to a reference pressure of 20 microPascals.
#' @param from value in mPa, Pa, dB, microvars or uPa
#' @param ref reference pressure in micropasals
#' @export
#' @examples dBtoPa(94,20)
#' 1.002374
#arguments: dB value, reference units
dBtoPa<- function (dB,ref = 20) {
uPa<-20*10^(dB/ref)
Pa<-uPa/1000000
#print( ifelse( missing(dB), 'Pa is not specified', paste('a =',a) ) )
return(Pa)
}
#dBtoPa(93.97,20)
#dBtoPa()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.