function [r]=  pcorr(Xp,Yp)
xsum = sum(Xp);
ysum = sum(Yp);
L=length(Xp);

yconj_sum=sum(conj(Yp));

num = L*(sum(Xp.*Yp))-(xsum)*(ysum);

denum = sqrt((L*sum(Xp.^2)-(xsum^2))*(L*sum(Yp.*conj(Yp))-(ysum*yconj_sum)));
r=num/denum;
end