function LL=logLikehood(f,r,c,sigma)
K=size(r,3);
[M N]=size(f);
C=repmat(c,[M N 1]);
SIGMA=repmat(sigma,[M N 1])+eps;
R=repmat(r,[M N 1]);
F=repmat(f,[1 1 K]);
P=(R./sqrt(2*pi*SIGMA)).*exp(-(F-C).^2./(2*SIGMA));
LL=sum(sum(log(sum(P,3)+eps)));