xcor2 {RSEIS}R Documentation

Cross Correlation

Description

Cross correlation of two signals

Usage

xcor2(a1, a2, DT, PLOT = FALSE, LAG = 100)

Arguments

a1 input signal 1
a2 input signal 1
DT deltaT in seconds
PLOT logical TRUE=plot
LAG time lag for correlation function

Details

Illustrates the cross correlation of two time series.

Value

Return list from ccf, and position of maximum lag. Graphical Side effects.

Author(s)

Jonathan M. Lees<jonathan.lees.edu>

See Also

ccf

Examples


data(CE1)

ts1 = CE1$y[CE1$x>5.443754 & CE1$x<5.615951]

ts2 = CE1$y[CE1$x>5.760959]
ts2 = ts2[1:length(ts1)]

ts1 = ts1-mean(ts1)
ts2 = ts2-mean(ts2)

xc = xcor2(ts1, ts2, CE1$dt , PLOT = TRUE)


[Package RSEIS version 2.1-4 Index]