Learn R Programming

RSEIS (version 4.2-4)

STALTA: 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)

Value

vector of ratios

Arguments

y

vector, or time series

fwlen

forward number of samples

bwlen

backward number of samples

Author

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

Details

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

See Also

STLTcurve, PSTLTcurve

Examples

Run this code
### 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