% This program is given as an example to make the cross-correlation analysis, i.e., 
% to compute the cross-correlation between two signals (sig1 and sig2). 
%
% .......................................................................
% References: 
%
% Zhou YH, SalsteinDA, Chen JL, Revised atmospheric excitation function series 
%     related to Earth's variable rotation under consideration of surface topography, 
%     Journal of Geophysical Research, 111, D12108, doi:10.1029/2005JD006608, 2006.
%
% Zhou YH, Zheng DW, Liao XH, Wavelet analysis of interannual LOD, AAM 
%     and ENSO: 1997~98 El Nino and 1998~99 La Nino signals, Journal of Geodesy, 
%     Vol.75, Page 164-168, 2001.
% .......................................................................
%
% Yonghong Zhou, Feb 2009, at Shanghai Astronomical Observatory 
%
function example
t=[0:1000]'; % sampling interval=1
x=sin(2*pi/20*t)+randn(length(t),1);
y=x+randn(length(t),1);
corr=correlation(x,y);
axis([-100 100 -0.5 1]);