# Example 6.1
# Calculation of the gain
# Page no 249
import math
#Given data
n=1.5; # Refractive ondex of air
lambdaa=1550*10**-9; # Wavelength
c=3*10**8; # Velocity of light
p=5.73*10**-17; # Power spectral density
h=6.63*10**-34 # Planck constant
# Gain
f=c/lambdaa;
G=(p/(2*n*h*f))+1;
#Displaying results in the command window
print "\n Gain G =",round(G)
# Example 6.2
# Calculation of the variance of the signal–ASE beat noise
# Page no 255
import math
#Given data
a=1.3*10**-16; # PSD of an amplifier
f=7*10**9; # Cut off frequency
Pi=10*10**-6; # Input power
R=0.8; # Responsivity
G=20; # Gain of an amplifier
# The variance of the signal–ASE beat noise
G=10**(G/10.0);
P=G*Pi;
r=4*R**2*P*a*f;
r=r*10**9;
#Displaying results in the command window
print "\n The variance of the signal–ASE beat noise current is = ",round(r,2)," x 10**-9 A**2"
# The answers vary due to round off error
# Example 6.3
# Calculation of the (a) the variance of the signal–ASE beat noise current, (b) the variance of the ASE–ASE beat noise current, and (c) the total variance.
# Page no 257
import math
#Given data
G=30; # Gain
nsp=5;
R=0.8;
f1=16*10**9;
fe=9*10**9;
#Pi1=-60;
c=3*10**8; # Velocity of light
h=6.63*10**-34 # Planck constant
lambdaa=1530*10**-9; # Wavelegth
Pi1=-27; # Input power
Pi2=-60;
f0=16*10**9;
#(a) The variance of the signal–ASE beat noise current for Pin=-27dBm
Po=G+Pi1;
Po=10**(Po/10.0);
Po=Po*10**-3;
G=10**(G/10.0);
f=c/lambdaa;
r=nsp*h*f*(G-1);
B=8*10**9;
#B=min(f/2,fe);
r0=4*R**2*Po*r*B;
#r0=r0*10**12;
#(b) The variance of the ASE–ASE beat noise current
r1=R**2*r**2*((2*f0)-fe)*fe;
#r1=r1*10**11;
# (c) The total variance.
rt=r0+r1;
# Displaying results in the command window
print "\n (a) The variance of the signal–ASE beat noise current for Pin=-27dBm"
print "\n The variance of the signal–ASE beat noise current = ",round(r0*10**8,2)," x 10**-8 A**2"
print "\n The variance of the ASE–ASE beat noise current = ",round(r1*10**11,2)," x 10**-11 A**2"
print "\n The total variance = ",round(rt*10**8,3)," x 10**-8 A**2"
# The answers vary due to round off error
#Given data
G=30; # Gain
nsp=5;
R=0.8; #
f1=16*10**9;
fe=9*10**9;
#Pi1=-60;
c=3*10**8; # Velocity of light
h=6.63*10**-34 # Planck constant
lambdaa=1530*10**-9; # Wavelegth
Pi1=-27; # Input power
Pi2=-60;
f0=16*10**9;
#(b) The variance of the signal–ASE beat noise current for Pin=-60dBm
Po2=G+Pi2;
Po=10**(Po2/10);
Po=Po*10**-3;
G=10**(G/10);
f=c/lambdaa;
r=nsp*h*f*(G-1);
B=8*10**9;
#B=min(f/2,fe);
r0=4*R**2*Po*r*B;
#r0=r0*10**12;
#(b) The variance of the ASE–ASE beat noise current
r1=R**2*r**2*((2*f0)-fe)*fe;
#r1=r1*10**11;
# (c) The total variance.
rt=r0+r1;
# Displaying results in the command window
print "\n \n (b) The variance of the signal–ASE beat noise current for Pin=-60dBm"
print "\n The variance of the signal–ASE beat noise current = ",round(r0*10**11,2)," x 10**-11 A**2"
print "\n The variance of the ASE–ASE beat noise current = ",round(r1*10**11,2)," x 10**-11 A**2"
print "\n The total variance = ",round(rt*10**11,2)," x 10**-11 A**2 "
# Example 6.4
# Calculation of the amplifier gain
# Page no 262
import math
#Given data
Po=0; # Signal output of amplifier
#f=7*10**9; # Cut off frequency
B=7.5*10**9; # Bandwidth
R=0.9; # Responsivity
c=3*10**8; # Velocity of light
lambdaa=1550*10**-9; # Operating frequency
fn=4.5; # Noise figure
Ro=0.066*10**-3; # Beat noise current
h=6.626*10**-34; # Planck constant
# The amplifier gain
P=10**(Po/10)*10**-3;
r=Ro**2/(4*R**2*B*P);
fn=10**(fn/10);
f=c/lambdaa;
G=(1/fn)*(((2*r)/(h*f))+1);
#Displaying results in the command window
print "\n The amplifier gain = ",round(G)
# The answers vary due to round off error
# Example 6.5
# Calculation of the OSNR in a bandwidth of 12.49 GHz.
# Page no 263
import math
#Given data
G=25; # Gain
c=3*10**8; # Velocity of light
h=6.63*10**-34 # Planck constant
lambdaa=1545*10**-9; # Wavelegth
Pi=-22; # Input power
fn=6;
B=12.49*10**9;
# The OSNR in a bandwidth of 12.49 GHz
Po=G+Pi;
Po=10**(Po/10.0);
Po=Po*10**-3;
fn=10**(fn/10.0);
G=10**(G/10.0);
f=c/lambdaa;
r=(G*fn-1)*(h*f/2.0);
O=Po/(2*r*B);
O=10*math.log10(O);
# Displaying results in the command window
print "\n The OSNR in a bandwidth of 12.49 GHz = ",round(O,2)," dB"
# The answers vary due to round off error
# Example 6.6
# Calculation of the single-pass gain and 3-dB bandwidth
# Page no 268
import math
#Given data
c1=3*10**8; # Velocity of light
f=7*10**9; # Cut off frequency
L=500*10**-6; # Input power
Gp=15; # Peak gain
n=3.2;
Gs=2.52;
R=0.32;
a=0.1024;
b=-0.6546;
c=1;
# The single-pass gain
x1 =( -1*b+ math.sqrt ((b **2) -4*a*c)) /(2* a); # 1 s t r o o t
x2 =( -1*b- math.sqrt ((b **2) -4*a*c)) /(2* a); # 2nd r o o t
# The 3-dB bandwidth
G=10**(Gp/10.0);
x=(1-(R*x2))/(2*math.sqrt(R*x2));
f=(c1/(math.pi*L*n))*math.asin(x);
# f=f*10**-9;
# Displaying results in the command window
print "Single pass gain Gs= ",round(x1,2)," or"
print "\nSingle pass gain Gs= ",round(x2,2)
print "\nThe the 3-dB bandwidth = ",round(f*10**-9,2)," GHz "
# The answers vary due to round off error
# Example 6.7
# Calculation of (a) the saturation power and (b) the bias current I
# Page no 273
import math
#Given data
c=3*10**8; # Velocity of light
lambdaa=1530*10**-9; # Wavelength
t=0.3 # Overlap factor
r=7.3*10**-20; # Gain cross section
r0=1*10**-9; # Carrier lifetime
q=1.609*10**-19;
v=7.5*10**-16; # Active volume
h=6.63*10**-34 # Planck constant
A=5*10**-6; # Effective area
g=4.82*10**3; # Small signal gain coeffifient
N=3.5*10**23; #
# (a) the saturation power and
f=c/lambdaa;
Ps=(h*f*A)/(t*r*r0);
Ps=Ps*10**-3;
# (b) the bias current I
I=(g/(r*r0)+N/r0)*q*v;
I=I*10**3;
# Displaying results in the command window
print "\n The saturation power Psat = ",round(Ps,3)," mW "
print "\n The bias current I = ",round(I,3)," mA "
# The answers vary due to round off error
# Example 6.9
# Calculation of the variance of the signal–ASE beat noise current.
# Page no 290
import math
#Given data
si=30.0; # Electrical SNRs at the amplifier input
so=25.0; # Electrical SNRs at the amplifier output
p=0; # Signal power at output
r=-126.0; # Signal power at input
R=0.9; # Planck constant
f=195*10.0**12; # Frequency
b=20*10.0**9; # Bandwidth
# The variance of the signal–ASE beat noise current
p1=10**(p/10)*10**-3;
rn=10**(r/10)*10**-3;
r1=rn*b;
r0=2*R**2*p1*r1;
#Displaying results in the command window
print "\n The variance of the signal–ASE beat noise current = ",round(r0*10**9,2)," x 10**-9 A**2 W/Hz"
# The value of noise power given in example as -126 but for calculation it is taken as -128 in book. Therefore answer is varying.
# Example 6.12
# Calculation of the ASE power spectral density per polarization.
# Page no 296
import math
#Given data
si=30.0; # Electrical SNRs at the amplifier input
so=25.0; # Electrical SNRs at the amplifier output
po=2; # Signal power at output
pi=-13; # Signal power at input
h=6.626*10**-34; # Planck constant
f=195*10**12;
# The ASE power spectral density per polarization
fn=si-so;
fn=10**(fn/10);
G=po-pi;
G=10**(G/10.0);
r=(h*f*(G*fn-1))/2;
r=r*10**18;
#Displaying results in the command window
print "\n The ASE power spectral density per polarization = ",round(r,3)," x 10**-18 W/Hz "
# Example 6.13
# Calculation of the geometric mean of the facet reflectivity R
# Page no 296
import math
#Given data
Gm=20.0;
G1=5.0;
# The geometric mean of the facet reflectivity R
Gmax=10**(Gm/10); # Peak Gain
Gs=10**(G1/10); # Single pass gain
R=(math.sqrt(Gs)-10)/(math.sqrt(Gs)-Gs*10);
#Displaying results in the command window
print "\n The geometric mean of the facet reflectivity R = ",round(R,3)
# Example 6.14
# Calculation of the upper bound on the single-pass gain
# Page no 297
import math
#Given data
n=3.5; # Refractive index
c1=3*10**8; # Velocity of light
L=200*10**-6; # Amplifier length
a=0.09;
b=-(1.2*0.1805**2+0.6);
c=1;
# The geometric mean of the facet reflectivity R
f=c1/(2*n*L);
x1 =( -1*b+ math.sqrt ((b **2) -4*a*c)) /(2* a); # 1 s t r o o t
x2 =( -1*b- math.sqrt ((b **2) -4*a*c)) /(2* a); # 2nd r o o t
#Displaying results in the command window
print "\n The geometric mean of the facet reflectivity R = ",round(f*10**-9,2)," GHz "
print "\n The upper bound on the single-pass gain Gs = ",round(x1,2)," or "
print "\n The upper bound on the single-pass gain Gs = ",round(x2,2)
# The answers vary due to round off error