Learn R Programming

PAMscapes (version 0.11.3)

createOctaveLevel: Create Octave Level Measurements

Description

Creates (third) octave level or broadband measurements from finer resolution soundscape metrics, like Power Spectral Density (PSD) or Hybrid Millidecade (HMD) measures

Usage

createOctaveLevel(
  x,
  type = c("ol", "tol", "broadband", "bb"),
  freqRange = NULL,
  normalized = FALSE
)

Value

a dataframe with summarised octave level band measurements

Arguments

x

dataframe of soundscape metrics

type

one of 'ol' to create octave level, 'tol' to create third octave level measures, or 'broadband' or 'bb' to create an arbitrary broadband measure. For broadband measures, freqRange must be supplied to define the range

freqRange

a vector of the minimum and maximum center frequencies (Hz) desired for the output. If NULL, full available range of frequencies will be used. If output type is broadband, this is used to define the lower and upper bounds of the desired output broadband level

normalized

logical flag to return values normalized by the bandwidth of each octave level band (per Hz)

Author

Taiki Sakai taiki.sakai@noaa.gov

Details

To create new measurements, finer resolution metrics are cast to linear space, summed, and then re-logged. If input measurements are HMD values then they are assumed to be normalized per Hz, so levels are first corrected by the bandwidth before summing. In all other cases inputs are assumed to not be normalized per Hz measurements and are just summed.

Examples

Run this code
psd <- loadSoundscapeData(system.file('extdata/PSDSmall.csv', package='PAMscapes'))
str(psd)
tol <- createOctaveLevel(psd, type='tol')
str(tol)
ol <- createOctaveLevel(tol, type='ol')
str(ol)
bb <- createOctaveLevel(psd, type='bb', freqRange=c(20, 150))
str(bb)

Run the code above in your browser using DataLab