Learn R Programming

eseis (version 0.5.0)

signal_stalta: Calculate stal-lta-ratio.

Description

The function calculates the ratio of the short-term-average and long-term-average of the input signal.

Usage

signal_stalta(data, time, dt, sta, lta, freeze = FALSE, on, off)

Arguments

data

eseis object, numeric vector or list of objects, data set to be processed.

time

POSIXct vector, time vector of the signal(s). If not provided, a synthetic time vector will be created.

dt

Numeric value, sampling period. If omitted, either estimated from time or set to 0.01 s (i.e., f = 100 Hz).

sta

Numeric value, number of samples for short-term window.

lta

Numeric value, number of samples for long-term window.

freeze

Logical value, option to freeze lta value at start of an event. Useful to avoid self-adjustment of lta for long-duration events.

on

Numeric value, threshold value for event onset.

off

Numeric value, threshold value for event end.

Value

data frame, detected events (ID, start time, duration in seconds).

Examples

Run this code
# NOT RUN {
## load example data
data(rockfall)

## filter signal
rockfall_f <- signal_filter(data = rockfall_eseis,
                            f = c(1, 90), 
                            p = 0.05)
                    
## calculate signal envelope
rockfall_e <- signal_envelope(data = rockfall_f)

## pick earthquake and rockfall event
signal_stalta(data = rockfall_e,
              sta = 100, 
              lta = 18000, 
              freeze = TRUE, 
              on = 5, 
              off = 3)
              
                     
# }

Run the code above in your browser using DataLab