# Crosscorrelation and autocorrelation

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Series Investigations in Geophysics Öz Yilmaz http://dx.doi.org/10.1190/1.9781560801580 ISBN 978-1-56080-094-1 SEG Online Store

Seismic data processing often requires measurement of the similarity or time alignment of two traces. Correlation is another time-domain operation that is used to make such measurements. Consider the following two wavelets:

Wavelet 1: (2, 1, −1, 0, 0)
Wavelet 2: (0, 0, 2, 1, −1)

Although these wavelets are identical in shape, wavelet 2 is shifted by two samples with respect to wavelet 1. The time lag at which they are most similar can be determined. To do this, perform the operation on wavelet 1 as described in Table 1-5 without reversing wavelet 2 (omit Step 1). This is crosscorrelation and the result is shown in Table 1-7. Crosscorrelation measures how much two time series resemble each other.

 Fixed Array: a0, a1, a2, a3, a4, a5, a6, a7 Moving Array: b0, b1, b2 Given two arrays, ai and bj: Step 1 : Reverse moving array bj. Step 2 : Multiply in the vertical direction. Step 3 : Add the products and write as output ck. Step 4 : Shift array bj one sample to the right and repeat Steps 2 and 3. Convolution Table: a0 a1 a2 a3 a4 a5 a6 a7 Output b2 b1 b0 c0 b2 b1 b0 c1 b2 b1 b0 c2 b2 b1 b0 c3 b2 b1 b0 c4 b2 b1 b0 c5 b2 b1 b0 c6 b2 b1 b0 c7 b2 b1 b0 c8 b2 b1 b0 c9 where ${c_{k}}=\sum \limits _{j=0}^{n}{{a_{k-j}}\;{b_{j}},}\quad k=0,\;1,\;2,\;\cdots \;,m\;+\;n\;-\;1.$ 2 1 -1 0 0 Output Lag 0 0 2 1 -1 -2 -4 0 0 2 1 -1 1 -3 0 0 2 1 -1 6 -2 0 0 2 1 -1 1 -1 0 0 2 1 -1 -2 0 0 0 2 1 -1 0 1 0 0 2 1 -1 0 2 0 0 2 1 -1 0 3 0 0 2 1 -1 0 4

From Table 1-7, note that maximum correlation occurs at lag −2. This suggests that if wavelet 2 were shifted two samples back in time, then these two wavelets would have maximum similarity.

Table 1-8 shows the crosscorrelation values that result when the arrays are interchanged. This time the maximum correlation occurs at lag 2. Thus, if wavelet 1 were shifted by two samples forward in time, these two wavelets would have maximum similarity.

 0 0 2 1 -1 Output Lag 2 1 -1 0 0 -0 -4 2 1 -1 0 0 0 -3 2 1 -1 0 0 0 -2 2 1 -1 0 0 0 -1 2 1 -1 0 0 -2 0 2 1 -1 0 0 1 1 2 1 -1 0 0 6 2 2 1 -1 0 0 1 3 2 1 -1 0 0 -2 4
 Wavelet 1 with Wavelet 2 Crosscorrelation Output Lag Wavelet 2 with Wavelet 1 -2 -4 0 1 -3 0 6 -2 0 1 -1 0 -2 0 -2 0 1 1 0 2 6 0 3 1 0 4 -2

Unlike convolution, crosscorrelation is not commutative — the output depends on which array is fixed and which is moved. Table 1-9 shows a comparison of the crosscorrelation results listed in Tables 1-7 and 1-8.

Crosscorrelation of a time series with itself is known as autocorrelation. Table 1-10 shows the autocorrelation lags of wavelet 1. Note that maximum correlation occurs at zero lag, an important property of autocorrelation. Moreover, the autocorrelation function is symmetric. This is a property of a real time series. Therefore, only one side of the autocorrelation needs to be computed.

It is heuristically shown in the next section on frequency filtering that convolution in the time domain is equivalent to multiplication in the frequency domain . Since correlation is a convolution without reversing the moving array (Table 1-5), a similar frequency-domain operation also applies to correlation.

 2 1 -1 0 0 Output Lag 2 1 -1 0 0 -0 -4 2 1 -1 0 0 0 -3 2 1 -1 0 0 -2 -2 2 1 -1 0 0 1 -1 2 1 -1 0 0 6 0 2 1 -1 0 0 1 1 2 1 -1 0 0 -2 2 2 1 -1 0 0 0 3 2 1 -1 0 0 0 4 Figure 1.1-19  The frequency-domain description of convolution and correlation.

Figure 1.1-19 is a summary of frequency-domain descriptions of convolution and correlation. Note the following properties for convolution and correlation:

1. Both convolution and correlation produce an output with a spectral bandwidth that is common to both of the input series. The immediate example is the band-pass filtering process.
2. Phases are additive in case of convolution and subtractive in case of correlation .
3. For autocorrelation, this implies that the output series is zero-phase. This fact already was verified by the example in Table 1-10 where it was shown that the autocorrelation is symmetric with respect to zero lag.

As a measure of similarity, crosscorrelation is used widely at various stages of data processing. For instance, traces in a CMP gather are crosscorrelated with a pilot trace to compute [[Residual statics corrections|residual statics shifts. The fundamental basis for computing velocity spectra is crosscorrelation (velocity analysis). The constituent elements of the Wiener filter are crosscorrelation of the desired output waveform with the input wavelet, and autocorrelation of the input wavelet.