# Variable Declaration
SNR_dB = 32.00 # Signal to Noise ratio (dB)
f1 = 300.00 # Lower Limit of Voice Frequency (Hz)
f2 = 3400.0 # Upper Limit of Voice Frequency (Hz)
# Calculation
import math # Math Library
SNR = pow(10,SNR_dB/10) # Signal to Noise Ratio
C = (f2-f1)*math.log(1+SNR,2) # Capacity of Telephone Channel (bps)
# Result
print "The capacity of a standard 4 kHz telephone channel with 32 dB SNR is C =",round(C,1),"bits per second."
# Variable Declaration
SNR_dB = 28.00 # Signal to Noise ratio (dB)
BW1 = 4.00*pow(10,3) # System Bandwidth 1 (Hz)
BW2 = 8.00*pow(10,3) # System Bandwidth 2 (Hz)
# Calculation
import math # Math Library
SNR1 = pow(10,SNR_dB/10) # Signal to Noise Ratio 1
C1 = BW1*math.log(1+SNR1,2) # Information Carrying Capacity (bps)
SNR2 = pow(10,SNR_dB/10)/2 # Signal to Noise Ratio 2
C2 = BW2*math.log(1+SNR2,2) # Information Carrying Capacity (bps)
# Result
print "(a) The information carrying capacity of a standard 4 kHz telephone channel with 28 dB SNR is C1 =",round(C1),"bits per second."
print "(b) The information carrying capacity of a standard 8 kHz telephone channel with same signal power as in (a) is C2 =",round(C2),"bits per second."
print " Also the ratio of the two quantities, C2/C1 =",round(C2/C1,3)