Calculate the estimated depth of echolocation clicks using surface reflected echoes. This uses the time delay between the received signal and its surface echo to estimate the depth of a calling animal. Requires that a set of waveform clips has been created using writeEventClips, and that events have been localized.
calculateEchoDepth(
x,
wav,
clipLen = 0.03,
spParams = NULL,
soundSpeed = 1500,
hpDepthError = 1,
locType = "PGTargetMotion",
plot = TRUE,
nPlot = 400,
nCol = 5,
plotDir = NULL,
plotIci = TRUE,
maxIci = 2.5,
sr = NULL,
progress = TRUE,
verbose = TRUE
)
the AcousticStudy object x
with estimated dive depth outputs
added for each detection that had a matching wav clip file in wav
.
Detections that either did not have matchinf wav files or did not have
localizations will have NA
for all dive depth outputs. The depth outputs
are
Delay time with maximum correlation value
Delay time with second highest correlation value
Delay time with third highest correlation value
Correlation magnitude for "maxTime"
Correlation magnitude for "pair2Time"
Correlation magnitude for "pair3Time"
Calculated depth for "maxTime"
Calculated depth for "pair2Time"
Calculated depth for "pair3Time"
AcousticStudy object
either folder containing wave clips or list of wave clip files
length (seconds) of clip to analyze
list of species-specific parameters, see details
sound speed (meters/second) to use for calculations
maximum error (meters) in hydrophone depth measurement
name of localization, note that this function is not computing any localization, only using previously calculated
logical flag to create summary plots
number of waveform plots to create for summary
number of columns for waveform summary plot
directory to store plot outputs, default NULL
will result
in no plots being created
logical flag to additionally create ICI plots
maximum allowed ICI value (seconds)
if not NULL
(default), clips in wav
will be decimated
to match this sample rate
logical flag to show progress bar
logical flag to show messages
Taiki Sakai taiki.sakai@noaa.gov
spParams
allows for species-specific filtering and acceptable
echo time delays to be specified. These are provided as a list with elements
freqLow
and freqHigh
specifying the lower and upper ends of a
bandpass filter to apply to the signals (in Hz), which can aid in properly
detecting the echoes. Parameters minTime
and maxTime
can
also be supplied to define ranges on allowed time delay values. Alternatively
if maxTime
is NULL
or not present it will be calculated from the
hydrophone geometry, and minTime
can be calculated from geometry by
providing minDepth
and maxRange
as the minimum detectable depth
and maximum detectable range (in meters).
If the same values for these parameters should be used for all detections in
x
, then spParams
can be provided as a list with each parameter named,
e.g.
list(freqLow=10e3, freqHigh=50e3, minTime=.001, maxTime=NULL)
If different values should be used for different species, then spParams
must be a named list where the names match the species in x
, providing
a separate list of values for each species. e.g.
list(Zc=list(freqLow=10e3, freqHigh=50e3, minTime=.001, maxTime=NULL),
Pm=list(freqLow=2e3, freqHigh=16e3, minTime=.001, maxTime=NULL))
# example not run because it requires access to large files not present
# in the package testing material
if (FALSE) {
study <- addRecordings(study, folder='path/to/recordings')
wavPath <- 'path/to/wavFiles'
writeEventClips(study, outDir=wavPath, mode='detection')
study <- calculateEchoDepth(study, wav=wavPath)
}
Run the code above in your browser using DataLab