chapter 8 Digital Communication-Coding Techniques

Example 8.1 Page no 357

In [3]:
#given
fa=20*10**3

#calculation
fs=2*fa                                     #minimum sample rate

#result
print"maximum sample rate","is greater than equal to",fs,"Hz"        #frequency
  
maximum sample rate is greater than equal to 40000 Hz

Example 8.2 Page no 362

In [9]:
#given
dr=55

#calculation
import math
n=(dr/6.02)
l=2**10
y=10*math.log10(3*(l**2))             #signal-to-quantization-noise level
x=(1.76+(6.02*10))                    #signal-to-noise ratio for digitizing system

#result
print"(S/N)q =",round(y,2),"dB"
(S/N)q = 64.98 dB

Example 8.3 Page no 368

In [12]:
#given
R=100.0*10**3                    #resistance, ohm
Rf=10*10**3
Vref=-10                         #reference voltage

#calculation
Vo=-(Vref)*(Rf/R)                # resolution
a=(10/100.0)
b=(10/50.0)
c=(10/25.0)
d=(10/12.5)
V=-(Vref)*(a+b+c+d)              #output voltage

#result
print"The step-size is ",Vo
print"output voltage = ",V,"volts"
The step-size is  1.0
output voltage =  15.0 volts

Example 8.4 Page no 375

In [15]:
#given
d=2                     #Dmin
d1=3
d2=4

#calculation
x=d-1               
a=(d/2.0)-1
y=d1-1
b=1/2.0*(d1-1)
z=d2-1
c=(d2/2.0)-1 
#part (a)

#result
print"(a) the no. of error detected for the distance 2 is ",x
print" the no. of errors corrected  = ",a
print"(b) the no. of error detected for the distance 3 is ",y
print" the no. of errors corrected  = ",b
print"(c) the no. of error detected for the distance 4 is ",z
print" the no. of errors corrected  = ",c
(a) the no. of error detected for the distance 2 is  1
 the no. of errors corrected  =  0.0
(b) the no. of error detected for the distance 3 is  2
 the no. of errors corrected  =  1.0
(c) the no. of error detected for the distance 4 is  3
 the no. of errors corrected  =  1.0