pick_correlation {eseis} | R Documentation |
Signal correlation based event picking
Description
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.
Usage
pick_correlation(data, on, template, dur_min, time, dt)
Arguments
data |
|
on |
|
template |
|
dur_min |
|
time |
|
dt |
|
Value
data.frame
, picked events.
Author(s)
Michael Dietze
Examples
## create synthetic event signal
p <- sin(seq(0, 10 * pi, by = 0.35)) * 0.2 *
(1 + sin(seq(0, pi, length.out = 90)))^5
## show event signal
plot(p, type = "l")
## create synthetic noise signal
x <- 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 noise
for(k in 1:length(ii)) {
nn <- ii[k]:(ii[k] + 89)
x[nn] <- x[nn] + p
}
## show resulting time series
plot(x = t, y = x, type = "l")
## pick events based on template
picks <- eseis::pick_correlation(data = x,
on = 0.8,
template = p,
time = t,
dt = 1/200)
## show result
print(picks)