function c = shannon_rate( snr_db, r)
snr = db2pow(snr_db);
p=0.5*erfc(sqrt(snr*r));
c=1+p*log2(p)+(1-p)*log2(1-p);
