--
You received this message because you are subscribed to the Google Groups "seewave" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seewave+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello Adam,
What exactly do you need to know: just the time of each pulse/peak or its duration as well - the latter is more difficult, more so if starts and ends overlap.
For peak detection (thence timing) there is the package "Peaks" in R which includes Markov smoothing procedures. I may be wrong but I think the main smoothing obtained with the Hilbert transform is just because a window of n samples is used for the transform. From your spectrogram, Markov smoothing over a much shorter window (n < 10) could be simpler and with higher precision,
For determining the beginning and ends (peak width), I was unsuccessful when looking for suitable existing code (R or C++) for noisy data and had to set about it myself (work in progress - sorry!). The simplest, which may be all you need, would be measures of when each pulse passes above/below a given faction of the peak height.I don't know of a package for doing that though.
Krzysz
--
amppeaks=function(wave, f, threshold=1.2, plot = TRUE
, smooth = 3000, col = 2, cex = 1, symbol = ".",clip.value=7.5,...)
{
input <- inputw(wave = wave, f = f)
f <- input$f
smoothenv <- env(input$w,ssmooth=smooth,f,plot=F)
rm(input)
loc.max <- which(smoothenv > threshold*mean(smoothenv))
amp <- smoothenv[loc.max]
if (is.na(mean(amp))) {clipped=0;amp=0;loc.max=0} else if (mean(amp)<clip.value) {clipped=0} else {clipped=1}
if (plot) {
plot(smoothenv~c(1:length(smoothenv)/f), type="h",ylab="amplitude",xlab="time (seconds)")
text(x = loc.max/f, y = max(smoothenv), labels = symbol, cex = cex, col = col)
}
return(data.frame(val = amp, loc = (loc.max/f), clipped = clipped))
}
--
You received this message because you are subscribed to the Google Groups "seewave" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seewave+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Muséum national d'Histoire naturelle Institut Systématique, Evolution, Biodiversité UMR 7205 CNRS-MNHN-UPMC-EPHE 45 rue Buffon 75005 Paris- France http://isyeb.mnhn.fr/SUEUR-Jerome ## International Society of Ecoacoustics https://sites.google.com/site/ecoacousticssociety/