# Example 9.1
# Calculation of the (a) the channel spacing, (b) the signal bandwidth in a channel and cther total bandwidth of the WDM signal, and (c) the total data rate.
# Page no 392
import math
#Given data
Bs=10*10**12; # Symbol rate
n=6; # Spectral efficiency
Fs=10*10**12; # Symbol rate
N=12; # No of channels
# (a) Channel spacing
B=Bs*math.log(64,2);
f=B/n;
# (b) Total bandwidth of the WDM signal
T1=(N-1)*f+(2*Fs)/2;
T1=T1*10**-12;
# (c) Total data rate
T2=N*B;
T2=T2*10**-12;
# Displaying results in the command window
print "\n Channel spacing = ",round(f*10**-12)," GHz "
print "\n Total bandwidth of the WDM signal = ",T1," GHz "
print "\n Total data rate = ",T2," Gb/s "
# Example 9.2
# Calculation of the total power at the fiber output.
# Page no 393
import math
#Given data
p=0; # Power per channel
fl=0.2; # Fiber loss
f=50; # Wavelength
# The total power at the fiber output.
pc=10**(0.1*p);
tp=pc*11;
tp1=10*math.log10(tp);
tfl=fl*f;
to=tp1-tfl;
#Displaying results in the command window
print "\n The total power at the fiber output = ",round(to,3)," dBm "
# Example 9.3
# Calculation of a) The lengths of the adjacent waveguides and b) phase shift phi1 and phi2.
# Page no 400
import math
#Given data
p=0; # Power per channel
fl=0.2; # Fiber loss
m1=100; # Wavelength
m2=110;
lambdaa1=1550*10**-9;
lambdaa2=1550.8*10**-9;
c=3*10**8; # Velocity of light
b0=5.87*10**6;
b1=4.86*10**-9;
# a) The lengths of the adjacent waveguides
l1=(2*math.pi*m1)/b0;
l2=(2*math.pi*m2)/b0;
# b) Phase shift phi1 and phi2.
dfdl=-(c/lambdaa1**2);
dbdl=2*math.pi*b1*dfdl;
phi1=2*math.pi*m1+(lambdaa2-lambdaa1)*l1*dbdl;
phi2=2*math.pi*m2+(lambdaa2-lambdaa1)*l2*dbdl;
#Displaying results in the command window
print "\n The lengths of the adjacent waveguides = ",round(l1*10**6,2)," micrometer "
print "\n The lengths of the adjacent waveguides = ",round(l2*10**6,2)," micrometer"
print "\n Phase shift phi1 = ",round(phi1*10**-2,2)," x 10**2 rad "
print "\n Phase shift phi2 = ",round(phi2*10**-2,2)," x 10**2 rad"
# The answers vary due to round off error
# Example 9.4
# Calculation of the maximum reach up to which the carrier orthogonality is preserved.
# Page no 408
import math
#Given data
b=22*10**-27; # Power launched in port 1
T=1.28*10**-9; # Guard interval
N=128; # Subcarriers
f=78.125*10**6; # Frequency spacing between subcarriers
# Bit rate of communication system
I=T/(b*2*math.pi*N*f);
I=I*10**-3;
#Displaying results in the command window
print "\n The maximum reach up to which the carrier orthogonality is preserved = ",round(I)," km "
# The answers vary due to round off error
# Example 9.5
# Calculation of the maximum reach up to which the carrier orthogonality is preserved.
# Page no 410
import math
#Given data
d=30*10**-12; # Delay
b=0.5*10**-8;
# The maximum reach up to which the carrier orthogonality is preserved
L=d/b;
L=L*10**3;
#Displaying results in the command window
print "\n The maximum reach up to which the carrier orthogonality is preserved = ",round(L,3)," mm "
# The answers vary due to round off error
# Example 9.6
# Calculation of the ODTM to multiplex data.
# Page no 411
import math
#Given data
f1=10*10**9;
f2=40*10**9;
# The ODTM to multiplex data
b1=1.0/(f1);
b2=1.0/(f2);
b1=b1*10**12;
b2=b2*10**12;
#Displaying results in the command window
print "\n Bit interval for 10 Gb/s signal is =",round(b1)," ps "
print "\n Bit interval for 40 Gb/s signal is = ",round(b2),"ps "
# The answers vary due to round off error
# Example 9.7
# Calculation of the (a) the total data rate and (b) the spectral efficiency.
# Page no 413
import math
#Given data
M=16;
np=2; # No of polarization
nc=24; # No of channels
bs=28*10**9; # Symbol rate per polarization
# (a) The total data rate
B=bs*math.log(M,2);
T=B*np*nc;
# (b) The spectral efficiency
N=bs*nc;
s=T/N;
#Displaying results in the command window
print "\n The total data rate = ",round(T*10**-12,3)," Tb/s "
print "\n The spectral efficiency = ",round(s,1)," b/s/Hz "
# Example 9.8
# Calculation of the number of subcarriers required to transmit information.
# Page no 413
import math
#Given data
M=4;
np=2; # No of polarization
nc=24; # No of channels
bs=10*10**9; # Symbol rate per polarization
d=5000*10**3; # Transmission distance
b=22*10**-27;
ts= 49.3*10**-9;
# The total data rate
B=bs*math.log(M,2);
T=d*b*math.pi*bs;
#L=T/(b*2*math.pi*N*bs);
N=(bs*ts)/2;
#Displaying results in the command window
print "\n The number of subcarriers required to transmit information = ",round(N)," "
# The answers vary due to round off error
# Example 9.9
# Calculation of the (a) the signal power/subcarrier/polarization at the fiber output, (b) the data rate and (c) the spectral efficiency
# Page no 414
import math
#Given data
fl=0.19; # Fiber loss
fg=70; # Fiber length
nc=24; # No of channels
ip=2;
bs=10*10**9; # Symbol rate per polarization
ts= 12.8*10**-9; # Symbol period
n=64; # No of subcarriers
np=2; # Launch power to the fiber
# (a) The signal power/subcarrier/polarization at the fiber output
T=fl*fg;
p=ip-T;
p1=10**(p/10);
s=p1/(np*n);
#s=s*10**4;
# (b) The data rate
bs=1/ts;
B=math.log(n,2)*bs;
bt=B*2*n;
# (c) the spectral efficiency
Tb=n*bs;
se=bt/Tb;
#Displaying results in the command window
print "\n The signal power/subcarrier/polarization at the fiber output = ",round(s*10**4,3)," x 10**-4 mW "
print "\n The data rate = ",bt*10**-9,"Gb/s "
print "\n The spectral efficiency = ",se," b/s/Hz "
# The answers vary due to round off error