function o = internode (dist_u, dist_d , theta_u , theta_d,k)
m = length(dist_u);
n =  length(dist_d);
mn = m*n;
d1 = reshape(repmat(dist_u',[n,1]),[mn,1]);
theta1 = reshape(repmat(theta_u',[n,1]),[mn,1]);
d2 = repmat(dist_d,[m,1]);
theta2 = repmat(theta_d,[m,1]);
D = (d1.^2 + d2.^2 - 2*d1.*d2.*cos(abs(theta1 - theta2))).^(1/2);
x = randn(m*n,k);
y=randn(m*n,k);
rayleigh = 1/2*sqrt(x.^2 + y.^2);
o = rayleigh./D.^4;
end 