Designing Rayleigh Fading Wireless Channel with particular properties
theta0 = 6.25*10^-4;
di = 10; %whatever it is
h = theta0.*.*di^(-3).*(1/sqrt(2)).*(randn(1,500) + 1i.*randn(1,500));
g = theta0.*.*di^(-3).*(1/sqrt(2)).*(randn(1,500) + 1i.*randn(1,500));