import math
SNR=40.0
#a) Determination of no . of bits /code
n=(SNR -(10*math.log10(3))-(-10))/(20*math.log10(2))
n=round(n,3)
print 'The no . of bits per code word is',n
print 'Rounded off to 8'
import math
q=1.0
W=4*10**3
n=8.0
#a) Determination of Tx Bandwidth
B=(1+q)*W*n
print 'a)The transmission BW is',B,'Hz'
#b) Determination of quantization S/N ratio
SN_dB=6*n
print 'b)The quantization S/N ration is',SN_dB