### easy example find P and S-wave arrivals, low noise
data(GH)
i = 6
z = GH$JSTR[[i]]
z.curve = STALTA(z, fwlen = 10, bwlen = 325)
ex = seq(from=0, length=length(z), by=GH$dt[i])
par(mfrow=c(2, 1) )
plot(ex, z, type='l')
plot(ex, z.curve, type = 'l' )
aa = peaks(z.curve, span = 11, do.pad = TRUE)
wa = which( aa & z.curve>50 )
abline(v=wa*GH$dt[i] , col='red')
par(mfg=c(1,1) )
abline(v=wa*GH$dt[i] , col='red')
Run the code above in your browser using DataLab