function CRLB=DSF2DLocFoUnkwn_CRLB(u,u_dot,S,fo,c,Qn,Qs,Qfo)
% CRLB=DSF2DLocFoUnkwn_CRLB(u,u_dot,fo,S,c,Qe,Qs,Qfo)
%
% CRLB for the object location (position and velocity) in 2-D by using
% frequency measurements at single time instant, source frequency unknown.
%
% Input:
%   u:      (2 x 1), object position
%   u_dot:  (2 x 1), object velocity
%   S:      (2 x M), sensor positions, M=number of sensors
%   fo:     scalar, center frequency
%   c:      scalar, signal propagation speed
%   Qn:     (M x M), measurement noise covariance matrix
%   Qs:     (2M x 2M), sensor position error covariance matrix
%   Qfo:    scalar, variance of available center frequency
%
% Output:
%   CRLB:  (4 x 4), CRLB for object location ([position; velocity])
%
% Reference:
% M. Ahmed, K. C. Ho, and G. Wang, "Localization of a moving source by
% frequency measurements," IEEE Trans. Signal Process., vol. 68,
% pp. 4839-4854, 2020.
%
% Musaab Ahmed, K. C. Ho	08-18-2021
%
%       Copyright (C) 2021
%       Computational Intelligence Signal Processing Laboratory
%       University of Missouri
%       Columbia, MO 65211, USA
%       hod@missouri.edu
%

M=length(S);
r=sqrt(sum((S-repmat(u,1,M)).^2));
a=zeros(M,2);b=a;C=zeros(M,2*M);de_fo=zeros(M,1);
for i=1:M
    su=S(:,i)-u;
    a(i,:)=fo/c*((u_dot/r(i)-(su'*u_dot*su)./r(i)^3)');
    b(i,:)=fo/c*((su./r(i))');
   de_fo(i)=1+1/c*(su'./r(i)*u_dot);
    C(i,:)=[zeros(1,2*(i-1)) -a(i,:) zeros(1,2*(M-i))];
end
f_w=[a b];
f_alpha=[de_fo C];
Q_alpha=blkdiag(Qfo,Qs);
X=f_w'/Qn*f_w;
Y=f_w'/Qn*f_alpha;
Z=f_alpha'/Qn*f_alpha+inv(Q_alpha);

CRLB= diag(inv(X)+X\Y/(Z-Y'/X*Y)*Y'/X);
   
% --------------------------------------------------------------
