Chpater 7: PERFORMANCE ANALYSIS OF DIGITAL COMMUNICATION SYSTEMS

Example 7.15, Page No 414

In [44]:
import math 

#initialisation of variables
T=1.0*10**-6             #ms
A=10.0*10**-3
N=1*10**-11

#CALCULATIONS
Eb=((A**2)*T)/2.0
Epb=math.sqrt(Eb/N)
Pb=(1.0/2)*math.erfc(Epb)*(1.0/4)

#RESULTS
print("Bit error probability = %.2f X 10^-4 " %(Pb*(10**4)))
print('Approximation error')
Bit error probability = 1.96 X 10^-4 
Approximation error

Example 7.16, Page No 420

In [45]:
import math

#initialisation of variables
Br=25*10**6             #bits/sec
N=2*10**-20             #Power spectral density of noise
A=1.0*10**-6
Ps=1*10**-12            # Normalized power

#CALCULATIONS
Tb=1.0/Br
Ps=(A**2)/2.0
Pe=1.0/2*(math.erfc((0.6*Ps*Tb)/N))
#RESULTS
print("Average probability of bit error is Pe= %.2f X 10^-4 " %(Pe*10))
Average probability of bit error is Pe= 1.98 X 10^-4 

Example 7.17, Page No 423

In [46]:
import math
#Find probability of error

#initialisation of variables
A=2.0
N0=2.0*10**-4  #power sepctral density

#CALCULATIONS
Tmin=(6.76*N0)/4

#RESULTS
print("The min time for which the signal should be extended is Tmin= %.3f X 10^-3 msec " %(Tmin*10**3))
The min time for which the signal should be extended is Tmin= 0.338 X 10^-3 msec 

Example 7.20, Page No 428

In [47]:
import math
#The average carrier

#initialisation of variables
Pe=10**-4
N0=2*10**10
T=1.0/10**6

#CALCULATIONS
E=6.76*N0
P=E/T
Eb=8.5171*N0
P2=Eb/T


#RESULTS
print("The average carrier = %.3f X 10^-3 mW " %(P2/10**17))
The average carrier = 1.703 X 10^-3 mW 

Example 7.21, Page No 430

In [48]:
import math
#The average carrier

#initialisation of variables
A=0.2*10**-3          #V
T=2*10**-6
N0=2*10**-15

#CALCULATIONS
Pe=(math.sqrt((A**2*T)/4*N0))

#RESULTS
print("The average carrier = %.3f X 10^-4 mW " %(Pe*10**15))
print("Approximation error")
The average carrier = 6.325 X 10^-4 mW 
Approximation error

Example 7.29, Page No 447

In [49]:
import math

#initialisation of variables
A=1.0
N0=2.0*10**-5  #power sepctral density

#CALCULATIONS
T=((3.71**2)*2*N0)/(A**2)
Br=1/T
#Results
print("Bit rate Br= %.2f k bits/sec" %(Br/(10**3)))
Bit rate Br= 1.82 k bits/sec

Example 7.31, Page No 448

In [50]:
import math

#initialisation of variables
Pe=10.0**-4 #probability of error of PSK
N0=2.0*10**-10
Br=10**6                  #Bit Rate


#CALCULATIONS
T=1.0/Br
E=N0*6.76
P=E/T
Eb=8.5171*N0
Pb=Eb/T
#Results
print("i) PSK system The required carrier power = %.2f mW" %(P*10**3))
print("ii) DPSK system The required carrier power = %.2f mW" %(Pb*10**3))
i) PSK system The required carrier power = 1.35 mW
ii) DPSK system The required carrier power = 1.70 mW

Example 7.32, Page No 450

In [51]:
import math

#initialisation of variables
A=0.2*10**-3                #V
T=2*10**-6                  #Sec
N0=2*10**-15


#CALCULATIONS
x=math.sqrt((A**2*T)/(4*N0))
Pe=(1.0/2)*math.erfc(x/math.sqrt(2.0))

#Results
print("Probability of error = %.2f X 10^-4" %(Pe*10**4))
#print("Channel Bandwidth  = %.5f MHz" %BW)
Probability of error = 7.83 X 10^-4

Example 7.36, Page No 453

In [52]:
import math

#initialisation of variables
Ap=1                #mV
En=192.3            #mV
Arms=707            #mV


#CALCULATIONS
Z=Arms/En
Pe=1.0/2*(math.erfc(math.sqrt(2)*(Z/math.sqrt(2))))

#Results
print("Probability of error is  %.7f " %Pe)
Probability of error is  0.0000001 

Example 7.37, Page No 454

In [53]:
import math

#initialisation of variables
Br=2.08*10**-6        #Bit Rate
N0=2*10**-8

#CALCULATIONS
Eb=(math.sqrt(3.3))/(5*10**7)   #Eb=bit energy
Ps=Eb*Br
BW=2*Br                  #Bandwidth
Es=286.39*N0
Ps2=(Es*Br)/2
BW2=(2*Br)/4

#Results
print("i) BPSK THe transmission bandwidth  = %.2f MHz" %(BW*10**6)) 
print("ii) For 16 ary PSK THe transmission bandwidth  = %.2f MHz" %(BW2*10**6)) 
i) BPSK THe transmission bandwidth  = 4.16 MHz
ii) For 16 ary PSK THe transmission bandwidth  = 1.04 MHz