Chapter 7 Digital communication techniques

Example 7.1 Page no 210

In [3]:
#Given
t = 71.4*10**-6

#calculation
f = 1/t
fourth_harmonic = f*4
min_sampling = 2*fourth_harmonic

#Result
print"(a) The frequency of the signal is ",round(f/10**3,1),"KHz"
print"(b) The fourth harmonic is ",round(fourth_harmonic/10**3,0),"KHz"
print"(c) Minimum sampling rate is ",round(min_sampling/10**3,0),"KHz"
(a) The frequency of the signal is  14.0 KHz
(b) The fourth harmonic is  56.0 KHz
(c) Minimum sampling rate is  112.0 KHz

Example 7.2 Page no 222

In [5]:
#Given
N = 14
discrete_levels = 2.0**N

#Calculation
num_vltg_inc =2**N-1
resolution = 12/discrete_levels 

#Result
print"(a) The numbedr of discrete levels that are represented using N number of bits are ",discrete_levels
print"(b) the number odf voltage increments required to divide the voltage range are ",num_vltg_inc
print"(c) Resolution of the digitization ",round(resolution*10**6,2),"microvolt"
(a) The numbedr of discrete levels that are represented using N number of bits are  16384.0
(b) the number odf voltage increments required to divide the voltage range are  16383
(c) Resolution of the digitization  732.42 microvolt

Example 7.3 Page no 225

In [7]:
#Given
N =12
SINAD1=78

#Calculation
SINAD2 = 6.02*N + 1.76
ENOB =(SINAD1 -1.76)/6.02

#Result
print"(a) The SINAD for 12 bit convertre is ",SINAD2,"db"
print"(b) The ENOB for the converter with SINAD of 78 dB is ",round(ENOB,2),"bits"   
(a) The SINAD for 12 bit convertre is  74.0 db
(b) The ENOB for the converter with SINAD of 78 dB is  12.66 bits

Example 7.4 Page no 233

In [9]:
#Gievn
Vm = 1.0
Vin = 0.25
mu =255

#Calculation
import math
Vout = (Vm*log(1+mu*(Vin/Vm)))/log(1+mu)
gain =Vout/Vin

#Result
print"The output voltage of the compander ",round(Vout,2),"volt"
print"Gain of the compander is ",round(gain,0)
The output voltage of the compander  0.75 volt
Gain of the compander is  3.0

Example 7.5 Page no 234

In [14]:
#Given
Vin = 0.8
Vm =1.0
mu =255

#Calculation
import math
Vout = (Vm*math.log(1+mu*(Vin/Vm)))/math.log(1+mu)
gain =Vout/Vin

#Result
print"The output voltage of the compander ",round(Vout,1),"volt"
print"Gain of the compander is ",round(gain,1)
The output voltage of the compander  1.0 volt
Gain of the compander is  1.2