Example 8.1, Page Number: 287¶

In :
import math

#variable declaration
system_margin = 6                           # (dB)
alpha = 3.5                                 #attenuation (dB/Km)
L =6                                        #Length of transmission path (Km)
lc = 1                                      #connector loss (dB)

#calculation
PT = 2*lc+alpha*L+system_margin             #total optical power loss(dB)

#result
print "Total optical power loss = " , round(PT) ,"dB"
Total optical power loss =  29.0 dB

Example 8.2, Page Number: 288¶

In :
import math

#variable declaration
Ps = 3                                       #laser output (dBm)
APD_sen = -32                                #APD sensitivity (dBm)
lsc = 1                                      #source connectorloss (dB)
ljc = 2*4                                    #two (jumper+connector loss) (dB)
alpha = 0.3                                  #attenuation (dB/Km)
L = 60                                       #cable length (Km)
cable_att = alpha*60                         #cable attenuation (dB)
lrc = 1                                      #receiver connector loss (dB)

#calculation
Allowed_Loss = Ps-APD_sen                                  # (dB)
system_margin = Allowed_Loss-lsc-ljc-cable_att-lrc         #system margin(dB)

#result
print "Allowed loss between light source and photodetector = ",Allowed_Loss,"dB"
print "The Final power margin = " , round(system_margin) , "dB"
Allowed loss between light source and photodetector =  35 dB
The Final power margin =  7.0 dB

Example 8.3, Page Number: 291¶

In :
import math

#variable declaration
t_tx = 15*10**-9                            #transmitter rise time(ns)
t_mat = 21*10**-9                           #material dispersion related rise time(ns)
t_mod = 3.9*10**-9                          #rise time resulting from modal dispersion(ns)
t_rx = 14*10**-9                            #receiver rise time(ns)

#calculation
tsys = math.sqrt(t_tx**2+t_mat**2+t_mod**2+t_rx**2)     #link rise time(ns)

#result
print "Link rise time = " , round(tsys*10**9),"ns"
Link rise time =  30.0 ns

Example 8.4, Page Number: 292¶

In :
import math

#variable declaration
t_tx = 25*10**-12                             #transmission rise time (sec)
t_GVD = 12*10**-12                            #GVD rise time (sec)
t_rx = 0.14*10**-9                            #receiver rise time (sec)

#calculation
tsys = math.sqrt(t_tx**2+t_GVD**2+t_rx**2)    #Link rise time(ns)

#result
print "System rise time = " , round(tsys*10**9,2) , "ns"
System rise time =  0.14 ns

Example 8.5, Page Number: 306¶

In :
import math

#variable declaration
bit_error_dur = 1*10**-3                       #bit-corrupting burst noise duration (ms)
B = 10*10**3                                   #data rate (kb/sec)

#calculation
N = B*bit_error_dur                            #number of bits affected by by burst error (MB/s)

#result
print "Number of bits affected by a burst error = " , round(N) , "Mb/s"
Number of bits affected by a burst error =  10.0 Mb/s

Example 8.6, Page Number: 308¶

In :
import math

#variable declaration
x=1

#calculation
polynomial = str(x**7)+"0"+str(x**5)+"0"+"0"+str(x**2)+str(x)+"1"     #generator polynommial

#result
print "The generator polynomial to 8-bit binary represantation = ",polynomial
The generator polynomial to 8-bit binary represantation =  10100111

Example 8.8, Page Number: 309¶

In :
import math

#variable declaration
N = 32.0                                    #number of CRC

#calculation
Ped = 1.0-(1.0/(2.0**N))                    #burst error

#result
print "Burst error detected by CRC = " , round(Ped*100,8), "%"
Burst error detected by CRC =  99.99999998 %

Example 8.9, Page Number: 309¶

In :
import math

#variable declaration
S = 8                                       #Reed-Solomon code with 1 byte
n = (2**S-1)                                #length of coded sequence
k = 239.0                                   #length of message sequence

#calculation
r = n-k                                     #number of redundent bytes