fracspy.detection.stacking.stalta#

fracspy.detection.stacking.stalta(tdf, dt, stw, ltw, gtw=0)[source]#

STA/LTA computation.

Computes Short Term Average / Long Term Average (STA/LTA) for a time-dependent function provided the short time window (STW), long time window (LTW) and a gap time window (GTW) between them.

Parameters:
tdfnumpy.ndarray

Time-dependent function of shape (nt,)

dtfloat

Time step of the tdf

stwfloat

Short time window in seconds (must be more than two time steps)

ltwfloat

Long time window in seconds (must be more than two time steps)

gtwfloat, optional, default: 0

Gap time window in seconds (must be non-negative)

Returns:
slfnumpy.ndarray

Time-dependent STA/LTA function

stanumpy.ndarray

Time-dependent STA function

ltanumpy.ndarray

Time-dependent LTA function

Notes

The LTA and STA are defined as root mean squares of the signal in the LTW and STW with subtracted constant level. This constant level is the minimum between the average of the signal in the STW and LTW. The LTW goes first, then there is a GTW (if non-zero) and then goes the STW. The value of LTA/STA is calculated for the time moment on the border of the GTW and STW. The time function is padded appropriately on the both sides to have a full-length preceding LTW + GTW and a full-length following STW.