STALTA: Short term, long term average ratio

View source: R/STALTA.R

STALTAR Documentation

Short term, long term average ratio

Description

Calculate the short term, long term average ratios of the squared amplitude in a time series.

Usage

STALTA(y, fwlen = 125, bwlen = 125)

Arguments

y

vector, or time series

fwlen

forward number of samples

bwlen

backward number of samples

Details

Calculates the ratio of the forward/backard mean square sum.

Value

vector of ratios

Note

All filtering or pre and post analysis should be done outside of ratio curve estimate.

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

See Also

STLTcurve, PSTLTcurve

Examples

### 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')




RSEIS documentation built on Sept. 13, 2024, 1:09 a.m.