The function picks (identifies) events from continuous data by comparing the data patterns against a template signal using Pearson's correlation coefficient, defining an event when that coefficient is above a threshold value.
pick_correlation(data, on, template, dur_min, time, dt)
Arguments
data: eseis object, numeric vector or list of objects, data set to be processed.
on: Numeric value, minimum correlation coefficient to define event occurence.
template: eseis object or signal vector, template event with which the data set is correlated.
dur_min: Numeric value, minimum duration of the event. This is required as the routine tends to identify multipe picks with similarly high correlation coefficients due to autocorrelation effects. If omitted, dur_min is set to 0, i.e., all picks are returned.
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).
Returns
data.frame, picked events.
Examples
## create synthetic event signalp <- sin(seq(0,10* pi, by =0.35))*0.2*(1+ sin(seq(0, pi, length.out =90)))^5## show event signalplot(p, type ="l")## create synthetic noise signalx <- runif(n =1000, min =-1, max =1)t <- seq(from = Sys.time(), length.out = length(x), by =1/200)ii <- floor(runif(n =3, min =100, max =900))## add events to noisefor(k in1:length(ii)){ nn <- ii[k]:(ii[k]+89) x[nn]<- x[nn]+ p
}## show resulting time seriesplot(x = t, y = x, type ="l")## pick events based on templatepicks <- eseis::pick_correlation(data = x, on =0.8, template = p, time = t, dt =1/200)## show resultprint(picks)