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.
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
)
a list with elements mag
, time
and wav
waveform to find echoes in. Can be a numeric vector, Wave, or WaveMC class object
sample rate of the waveform, if wav
is a Wave
or WaveMC
object it will use the samp.rate
slot
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.
length of clip (seconds) to analyse for echoes,
measured from start of wav
minimum magnitude of autocorrelation value to be considered a possible peak
minimum allowed echo time (seconds), this should be large enough to avoid correlating the original pulse with itself
maximum allowed echo time (seconds)
if wav
has multiple channels, channel to use
the number of potential echoes to return, times with the
n
highest autocorrelation magnitude will be returned
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
optional text to plot on the upper waveform plot
Taiki Sakai taiki.sakai@noaa.gov