# Crosscorrelation and autocorrelation

Series | Investigations in Geophysics |
---|---|

Author | Öz Yilmaz |

DOI | http://dx.doi.org/10.1190/1.9781560801580 |

ISBN | ISBN 978-1-56080-094-1 |

Store | 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.

Reflectivity Sequence | Output Response | ||||

1 | 0 | 12 | |||

- 12 | 1 | 1 | |||

- 12 | 1 | - 12 | |||

- 12 | 1 | 12 | |||

- 12 | 1 | - 14 |

Fixed Array: | ||||||||||||

a_{0}, a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}, a_{7}
| ||||||||||||

Moving Array: | ||||||||||||

b_{0}, b_{1}, b_{2}
| ||||||||||||

Given two arrays, a and _{i}b:
_{j} | ||||||||||||

Step 1 : Reverse moving array b.
_{j} | ||||||||||||

Step 2 : Multiply in the vertical direction. | ||||||||||||

Step 3 : Add the products and write as output c.
_{k} | ||||||||||||

Step 4 : Shift array b one sample to the right and repeat Steps 2 and 3.
_{j} | ||||||||||||

Convolution Table: | ||||||||||||

a_{0} |
a_{1} |
a_{2} |
a_{3} |
a_{4} |
a_{5} |
a_{6} |
a_{7} |
Output | ||||

b_{2} |
b_{1} |
b_{0} |
c_{0}
| |||||||||

b_{2} |
b_{1} |
b_{0} |
c_{1}
| |||||||||

b_{2} |
b_{1} |
b_{0} |
c_{2}
| |||||||||

b_{2} |
b_{1} |
b_{0} |
c_{3}
| |||||||||

b_{2} |
b_{1} |
b_{0} |
c_{4}
| |||||||||

b_{2} |
b_{1} |
b_{0} |
c_{5}
| |||||||||

b_{2} |
b_{1} |
b_{0} |
c_{6}
| |||||||||

b_{2} |
b_{1} |
b_{0} |
c_{7}
| |||||||||

b_{2} |
b_{1} |
b_{0} |
c_{8}
| |||||||||

b_{2} |
b_{1} |
b_{0} |
c_{9}
| |||||||||

where | ||||||||||||

Source Wavelet | Output Response | |||||

1 | - 12 | |||||

12 | 0 | 1 | 1 | |||

12 | 0 | 1 | - 12 | |||

12 | 0 | 1 | 12 | |||

12 | 0 | 1 | - 14 |

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 ^{[1]}. 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 is a summary of frequency-domain descriptions of convolution and correlation. Note the following properties for convolution and correlation:

- 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.
- Phases are additive in case of convolution and subtractive in case of correlation
^{[1]}. - 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.

## See also

- Analog versus digital signal
- Frequency aliasing
- Phase considerations
- Time-domain operations
- Convolution
- Vibroseis correlation
- Frequency filtering
- Practical aspects of frequency filtering
- Bandwidth and vertical resolution
- Time-variant filtering
- The 1-D Fourier transform

## References

- ↑
^{1.0}^{1.1}Bracewell, R. N., 1965, The Fourier transform and its applications: McGraw-Hill Book Co.