Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

xcor2

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

ccf

Return list from function ccf

mlag

maximum lag in time

mccx

value of ccf at max lag mlag

mlag2

maximum absolute value lag

mccx2

value of ccf at mlag2

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)

RSEIS

Seismic Time Series Analysis Tools

v3.9-3
GPL (>= 2)
Authors
Jonathan M. Lees [aut, cre], Jake Anderson [ctb], Leonard Lisapaly [ctb], Dave Harris [aut, cph]
Initial release
2020-08-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.