Learn R Programming

warbleR (version 1.0.1)

sig2noise: Measure signal to noise ratio

Description

sig2noise measure signal to noise ratio across multiple files.

Usage

sig2noise(X, mar)

Arguments

X
data frame output from manualoc().
mar
numeric vector of length one. Specifies the margins to subtract from/add to start and end points of manualoc() selection, respectively, over which to measure noise.

Value

  • manualoc data frame with a new variable for signal to noise calculations.

Details

A general margin to apply before and after the acoustic signal must be specified. Setting margins for individual calls that have been previously clipped from larger files may take some optimization, as will margins for calls within a larger file that are irregularly separated. When margins overlap with another acoustic signal close by, the signal to noise ratio (SNR) will be inaccurate. Any SNRs less than or equal to one suggest background noise is equal to or overpowering the acoustic signal. snrspecs can be used to troubleshoot different noise margins.

Examples

Run this code
data(list = c("Arre.aura","manualoc.df"))
writeWave(Arre.aura, "Arre.aura.wav") #save sound files

# specifying the correct margin is important
# use snrspecs to troubleshoot margins for sound files
sig2noise(manualoc.df[grep("Arre", manualoc.df$sound.files), ], mar = 0.2)

# this smaller margin doesn't overlap neighboring calls
sig2noise(manualoc.df[grep("Arre", manualoc.df$sound.files), ], mar = 0.1)

Run the code above in your browser using DataLab