Macro. Performs a time domain cross-correlation of a series.
CROSSCOR(series1, series2)
series1 |
- |
A series. |
series2 |
- |
A series. |
A table or series.
CONV(S1,REVERSE(S2)/(SERSIZE(S1)+SERSIZE(S2))
W1: gsin(128, 1/128, 4.0)
W2: gsin(128, 1/128, 4.0)
W3: crosscor(W1, W2)
performs a cross-correlation of two sine waves.
W1: grand(128, 1/128)
W2: gsin(128, 1/128, 4.0)
W3: crosscor(W1, W2)
performs the cross-correlation of a sine wave with a random series.
CROSSCOR calculates the cross-correlation directly in the time domain via convolution without normalization. Use XCORR for a time domain version that supports normalization and FXCORR for a frequency domain implementation.
The cross-correlation function is often used to indicate how "similar" one waveform is to another. The cross-correlation of the above sine waves returns a waveform with several distinct peaks, indicating that the two series are very similar at each point in time where the peaks occur.
The cross-correlation of the random series with the sine wave results in a waveform with some peaks, but the amplitude of the waveform is considerably reduced (try OVERPLOT), indicating that the two input series are very dissimilar.