% This program is given as an example to compute the multitaper coherence between two real
% 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, Zhao M, Chao BF, Interannual polar motion with relation to 
%      the North Atlantic Oscillation. Global and Planet Change, 18: 79-84, 1998
%
% Percival D. B. and A. T. Walden, Spectral Analysis for Physical Applications: 
%     Multitaper and Conventional Univariate Techniques. Cambridge, England: Cambridge 
%     University Press£¬1993.
% .............................................................................
%
% 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=sin(2*pi/20*t)+randn(length(t),1);
[squa,phase]=mtcoherence(x,y);