Chapter 10: Digital Signal

Example 10.1, Page 272

In [1]:
import math

#Variable Declaration

PR=0.01  #The Average power received(watts)
Tb=0.0001  #Bit period(seconds)
N0=10**-7  #Noise power(joule)

#Calculations


Eb=PR*Tb  #Energy per bit received (joule)
x=math.sqrt(Eb/N0)

from scipy import integrate
f=lambda t:math.exp(-t**2)
erf=integrate.quad(f,0,x)
erf1=erf[0]*(2/math.pi**0.5)
BER=(1-erf1)*(10**6)/2
BER=round(BER,2)

print "The Bit error rate is", BER,"*10^-6"
The Bit error rate is 3.87 *10^-6

EXample 10.2, Page 274

In [2]:
import math
#Variable Declaration
Rb=61   #Transmission rate (Mb/s)
ENR=9.5 #Required Energy to noise ratio(dB)

#Calculation

Rb=10*math.log10(61*10**6)  #Converting Transmission rate to dB
CNR=Rb+ENR  #Carrier to noise ratio
CNR=round(CNR,2)
#Results

print "Required Carrier to noise ratio is", CNR,"dB"
Required Carrier to noise ratio is 87.35 dB

Example 10.3, Page 275

In [2]:
#Variable Declaration
BER=10**-5  #Maximum allowable bit error rate

#Calculation

import math
from pylab import*
%matplotlib inline
x=linspace(8,10,11)  #Eb/N0 ratio represented by x
x1=x**0.5
for i in range(0,11):
   x[i]=10*math.log10(x[i])  #Converting x into decibels


erf=linspace(0,0,11)  #Initialization for erf function
Pe=linspace(0,0,11)   #Initialization for Probablity of error

from scipy import integrate
f=lambda t:math.exp(-t**2)
for i in range(0,10):
   k=integrate.quad(f,0,x1[i])
   erf[i]=k[0]*(2/math.pi**0.5)    
   Pe[i]=(1-erf[i])/2       #Probability of error

y=linspace(9,9.59,5)
z=linspace(BER,BER,5)
a=linspace(9.59,9.59,5)
b=linspace(0,BER,5)
plot(x,Pe)
plot(y,z)
plot(a,b)
xlabel('xdB')
ylabel('Pe(x)')
show() 
x=9.6   #The Eb/N0 ratio for Maximum BER(dB) from the graph
EbN0=x+2 #Eb/N0 ratio with implementation margin
#Results

print "The Eb/N0 ratio with allowable BER of 10^-5 and implementation margin of 2dB is",EbN0,"dB"
The Eb/N0 ratio with allowable BER of 10^-5 and implementation margin of 2dB is 11.6 dB