findEchoTimes: Find Estimated Echo Times

View source: R/findEchoTimes.R

findEchoTimesR Documentation

Find Estimated Echo Times

Description

Finds the estimated times of echoes in a waveform clip. This function was developed to estimate the time of a surface reflected echo of echolocation clicks of deep diving marine mammals. The times of echoes are estimated by finding peaks in the autocorrelation of a signal.

Usage

findEchoTimes(
  wav,
  sr = NULL,
  filter = NULL,
  clipLen = 0.03,
  peakMin = 0.01,
  minTime = 0.001,
  maxTime = NULL,
  channel = NULL,
  n = 3,
  plot = TRUE,
  plotText = NULL
)

Arguments

wav

waveform to find echoes in. Can be a numeric vector, Wave, or WaveMC class object

sr

sample rate of the waveform, if wav is a Wave or WaveMC object it will use the samp.rate slot

filter

filter to apply to wav, a vector of two numbers specifying the lower and upper bounds of the filter in Hz. A first value of 0 means no highpass filter is applied, a second value greater than sr/2 means no lowpass filter is applied.

clipLen

length of clip (seconds) to analyse for echoes, measured from start of wav

peakMin

minimum magnitude of autocorrelation value to be considered a possible peak

minTime

minimum allowed echo time (seconds), this should be large enough to avoid correlating the original pulse with itself

maxTime

maximum allowed echo time (seconds)

channel

if wav has multiple channels, channel to use

n

the number of potential echoes to return, times with the n highest autocorrelation magnitude will be returned

plot

logical flag to create plot, will create a two-panel plot of the waveform (top) and the autocorrelation (bottom). Points of the selected candidate echo times are also drawn

plotText

optional text to plot on the upper waveform plot

Value

a list with elements mag, time and wav

Author(s)

Taiki Sakai taiki.sakai@noaa.gov


TaikiSan21/PAMmisc documentation built on Oct. 15, 2024, 9:29 p.m.