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:
- tdf
numpy.ndarray
Time-dependent function of shape (nt,)
- dt
float
Time step of the tdf
- stw
float
Short time window in seconds (must be more than two time steps)
- ltw
float
Long time window in seconds (must be more than two time steps)
- gtw
float
, optional, default: 0 Gap time window in seconds (must be non-negative)
- tdf
- Returns:
- slf
numpy.ndarray
Time-dependent STA/LTA function
- sta
numpy.ndarray
Time-dependent STA function
- lta
numpy.ndarray
Time-dependent LTA function
- slf
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.