function R_tdoa = Cov_TDOA(ro, M)
%
% function R_tdoa = Cov_TDOA(ro, M)
%
% Generate the TDOA covariance matrix, corresponding to (43) in the
% reference below.
%
% Reference: S. Li and K. C. Ho, “Accurate and effective localization of an 
% object in large equal radius scenario,” IEEE Trans. Wireless Commun., 
% vol. 15, no. 12, pp. 8273-8285, Dec. 2016.
%

Gam = diag(ro.^2)^(-1);
Gam_L = diag(ro(2:M).^2)^(-1);
t = (trace(Gam)*Gam_L - Gam_L*ones(M-1,1)*ones(1, M-1)*Gam_L)^(-1);
K = (M-1)/trace(t);
R_tdoa = K*t;
