import math
#given
Pt=10.; #in microW
Pr=1.; #in microW
PtdBm=10*math.log10(Pt*10**-6/10**-3) #in dBm
print"Transmitter Power =",round(PtdBm,4),"dBm";
PrdBm=10*math.log10(Pr*10**-6/10**-3) #in dBm
print"Receiver Power =",round(PrdBm,4),"dBm";
Pm=PtdBm-PrdBm;
print"Power margin=",round(Pm,4),"dBm"; #misprint in book
import math
#given
Pt=25.; #in microW
Prd=15.; #in dBm
Ptd=10*math.log10(Pt*10**-6/10**-3) #in dBm
print"Transmitter Power =",round(Ptd,4),"dBm";
Pm=Ptd-Prd;
print"Power margin=",round(Pm,4),"dBm";
import math
#given
Pt1=-18; #in dBm for 50/125 micron fiber
Pt2=-10; #in dBm for 100/125 micron fiber
Pd=Pt1-Pt2;
print" Additional Power =",round(Pd,4),"dBm";
import math
#given
Plb=10; #in dBm for 50/125 micron fiber
Ps=3; #in dBm for safety margin
Prs=-30; #in dBm for receiver sensivity
Pt=Plb+Ps+Prs;
print"Link power budget =",round(Pt,4),"dBm";
Ptw=10**(Pt/10.)*1000;
print"Transmitter Power =",round(Ptw,4),"microW";
import math
#given
Is=0.5; #in A/W
Ir=1.5; #in microA
Xw=Ir/Is;
print"Electrical power required by PIN diode is =",round(Xw,4),"microW";
Pxw=10*math.log10(Xw/10**3);
print"Therefore, Electrical power required by PIN diode is =",round(Pxw,4),"dBm";
Ps=3; #in dB for safety margin
Tp=5; #in dB
Pt=Tp+Ps+Pxw;
print"Total Power Required =",round(Pt,4),"dBm";
import math
#given
fb=1.25; #in Gb/s
D=17; #in ps/nm.km
dL=0.5; #in nm
Lmax=1/fb/10**9/dL/10**-9/D/10**-12*10**-9;
print"Maximum Link span,Lmax =",round(Lmax,4),"km";
import math
#given
fb=2.5; #in Gb/s
Lmax=50.; #in km
dL=0.4; #in nm
D=1./fb/10**9/dL/10**-9/Lmax/10**-12*10**-9;
print"Maximum allowable dispersion,D =",round(D,4),"ps/nm-km";
import math
#given
Lmax=60.; #in km
D=17.; #in ps/nm.km
dL=0.5; #in nm
fb=1/Lmax/10**9/dL/10**-9/D/10**-12*10**-9;
print"Maximum system bit rate,fb =",round(fb,4),"Gb/s";
import math
#given
c1=4; #channel1
c2=8; #channel2
c3=16; #channel3
fb=2.5; #in Gb/s
Lmax1=6.1*10**3/(c1*fb)**2;
print"Maximum Link span for",c1,"channel, Lmax =",Lmax1,"km";
Lmax2=6.1*10**3/(c2*fb)**2;
print"Maximum Link span for",c2,"channel, Lmax =",Lmax2,"km";
Lmax3=6.1*10**3/(c3*fb)**2;
print"Maximum Link span for",c3,"channel, Lmax =",Lmax3,"km";
import math
#given
L=200; #in km
dL=1550; #in nm
R=10; #in Gb/s
Cd=17; #in ps/nm-km
w=0.1; #Assused bandwidth
Cd200=Cd*L;
print"Dispersion by 200km ofc =","{0:.1e}".format(Cd200),"ps/nm";
TCd=w*Cd200;
print"total chromatic dispersion =","{0:.1e}".format(TCd),"ps";
import math
#given
L=1.5; #in km
Ls=L/3; #in km
BwF=600; #in MHz
fb=1; #in Gbps
Bdlaser=0.71*BwF*L**-0.7*Ls**-0.25;
print"Laser bandwidth is",round(Bdlaser,4),"MHz";
mD=0.85*(fb*10**3/Bdlaser)**2;
print"Mean dispersion penalty is",round(mD,4),"dB";
import math
#given
E=0.182; #from table 12-11 for 2dB dispersion penalty
fb=622; #in Mb/s
dl=4; #in nm
ofdisp=3; #in ps/km-nm
Dmax=E/(10**-6*fb*dl);
print"Dmax is",round(Dmax,4),"ps/nm";
Lmax=Dmax/ofdisp;
print"Maximum link distance is",round(Lmax,4),"km";
import math
#given
E=0.115; #from table 12-11 for 2dB dispersion penalty
fb=622; #in Mb/s
dl=4; #in nm
ofdisp=3; #in ps/km-nm
Dmax=E/(10**-6*fb*dl);
print"Dmax is",round(Dmax,4),"ps/nm";
Lmax=Dmax/ofdisp;
print"Maximum link distance is",round(Lmax,4),"km";
import math
#given
mc=0.4; #in dB
sc=0.0; #in dB
dmax=2.8; #in dB
mt=-4.9; #in dBm
st=0.5; #in dBm
mr=-38.1; #in dBm
sr=0.48; #in dBm
mco=0.35; #in dB
sco=0.20; #in dB
ms=0.2; #in dB
ss=0.1; #in dB
E=0.182; #from table 12-11 for 2dB dispersion penalty
fb=156; #in Mb/s
dl=4; #in nm
ofdisp=2.8; #in ps/nm-km
Nco=7;
mD=2;
sD=0.1;
sH=2;
sCR=0.25;
Ns=4;
mH=0;
mCR=0.5;
L=50;
Ls=10;
Dmax=E/(10**-6*fb*dl);
print"Dmax is",round(Dmax,4),"ps/nm";
Lmax=Dmax/ofdisp;
print"Maximum link distance is",round(Lmax,4),"km";
mM=mt-mr-(mc*L+mco*Nco+ms*Ns+mD+mH+mCR);
print"Mean link margin is",round(mM,4),"dB";
sM=math.sqrt(st**2+sr**2+sc**2*L*Ls+sco**2*Nco+sD**2*sH**2+sCR**2);
print"Sigma link margin is",round(sM,4),"dB";
import math
#given
E=0.115;
fb=622; #in Mb/s
dl=4; #in nm
mt=0.1; #in dBm
mr=-31.5; #in dBm
mc=0.41; #in dB
L=25;
mco=0.12; #in dB
Nco=2;
ms=0.15; #in dB
Ns=4;
mD=1;
mH=0;
mCR=0;
sc=0.0; #in dB
st=-0.15; #in dBm
sr=0.3; #in dBm
sco=0.08; #in dB
ss=0.1; #in dB
ofdisp=2.8; #in ps/nm-km
sD=2;
sH=0;
sCR=0.0;
Ls=12;
Dmax=E/(10**-6*fb*dl);
print"Dmax is",round(Dmax,4),"ps/nm";
Lmax=Dmax/ofdisp;
print"Maximum link distance is",round(Lmax,4),"km"; #in book 4 is misprint for solving
mM=mt-mr-(mc*L+mco*Nco+ms*Ns+mD+mH+mCR);
print"Mean link margin is",round(mM,4),"dB"; #wrong in book
L=60;
Ls=12;
sM=math.sqrt(st**2+sr**2+sc**2*L*Ls+sco**2*Nco+ss**2*Ns+sD**2*sH**2+sCR**2);
print"Sigma link margin is",round(sM,4),"dB";
spm=mM-2*sM-1;
print"System power margin is",round(spm,4),"dB"; #answer is slighty difeerent due to mM=19.5
import math
#given
E=0.115;
fb=1062; #in Mb/s
dl=6; #in nm
mt=-8; #in dBm
mr=28.7; #in dBm
mc=0.4; #in dB
L=5;
mco=0.12; #in dB
Nco=8;
ms=0.2; #in dB
Ns=4;
mD=1;
mH=0;
mCR=1;
sc=0.0; #in dB
st=0.6; #in dBm
sr=0.75; #in dBm
sco=0.08; #in dB
ss=0.1; #in dB
ofdisp=2.8; #in ps/nm-km
sD=2;
sH=0;
sCR=0.25;
Ls=12;
Dmax=round(E/(10**-6*fb*dl)); #taking to nearest integer in ps/nm
print"Dmax is",round(Dmax,4),"ps/nm";
Lmax=Dmax/ofdisp;
print"Maximum link distance is",round(Lmax,4),"km";
mM=mt+mr-(mc*L+mco*Nco+ms*Ns+mD+mH+mCR);
print"Mean link margin is",round(mM,4),"dB";
L=60;
Ls=12;
sM=math.sqrt(st**2+sr**2+sc**2*L*Ls+sco**2*Nco+ss**2*Ns+sD**2*sH**2+sCR**2);
print"Sigma link margin is",round(sM,4),"dB";
mM=round(mM*10)/10; #talking only to 1 decimal place and rounding of other values
spm=mM-2*sM-1;
print"mM-2*sM =",mM-2*sM;
print"System power margin is",round(spm,4),"dB"; #answer is slighty diferent due to m\sM=1.03
import math
#given
Ncso=50;
a=3.6*10**-3;
m=0.05;
CSO=10*math.log10(Ncso*(a*m)**2);
print"CSO distortion for 50 channel optical system =",round(CSO,4),"dB";
import math
#given
CSO=-59.8; #in dB
y=10**(CSO/10);
print"AM modulation depth (m) = ","{0:.3e}".format(y);
asq=3.6*10**-3;
Ncso=50;
msq=(y/Ncso/asq/asq);
print"m^2 =","{0:.3e}".format(msq);
print"Decrease of AM modulation depth decrease the CSO distortion by =",round(math.sqrt(msq)*100,1),"percent";
import math
#given
Ncto=50;
b=1.07*10**-2;
m=0.05;
CTO=10*math.log10(Ncto*(1.5*b*m)**2);
print"CTO distortion for 50 channel optical system =",round(CTO,4),"dB";
#Answer in the book is misprinted
#The solution in the book is calculated without multipication of Ncto
import math
#given
Ncso=80;
a=2.43*10**-3;
b=4.65*10**-3;
m=0.05;
#Part (i)
CSO=10*math.log10(Ncso*(a*m)**2);
print"CSO distortion for 50 channel optical system for m = 5 percent CSOdB =",round(CSO,4),"dB";
#Part (ii)
CTO=10*log10(Ncso*(1.5*b*m)**2);
print"CTO distortion for 50 channel optical system for m = 5 percent CTOdB =",round(CTO,4),"dB";
#Part (iii)
m=0.03;
CSO=10*log10(Ncso*(a*m)**2);
# Value of a in the book is considered 2.4 instead of 2.43
print"CSO distortion for 50 channel optical system for m = 3 percent CSOdB =",round(CSO,4),"dB";
#Part (iv)
CTO=10*math.log10(Ncso*(1.5*b*m)**2);
print"CTO distortion for 50 channel optical system for m = 3 percent CTOdB =",round(CTO,4),"dB";
import math
#given
RIN=-150; #in dB
B=4*10**6;
m=0.04;
CNR=10*math.log10(m**2/(2*10**-15*B));
print" CNR =",round(CNR,4),"dB";
import math
#given
CNR=50; #in dB
Bch=4*10**6;
m=0.03;
RIN=m**2/2/Bch/10**(CNR/10)
print"RIN =","{0:.3e}".format(RIN);
#Miscalculated answer in the book
RINdB=10*log10(RIN);
print"RIN in Db is",round(RINdB,4);
import math
#given
Ipd=0.15; #in mA
n=0.75;
e=1.6*10**-19; #electron charge
hv=1.55*10**-19;
Pin=hv*Ipd/n/e;
print"Pin =",round(Pin,4),"mW"; #Result
#answer in book is misprint
import math
#given
OBR=-40; #in dB
#y=Pref/Pin
y=10**(OBR/10.);
print" Prefl =",round(y*100,4),"percent Pin";
import math
#given
R=800; #in V/W
Pin=1.5; #in mW
m=0.04;
Voutp=R*Pin*m;
print"Vout(peak) =",Voutp,"mV";
Vavg=Voutp/math.sqrt(2);
print"Vavg =",round(Vavg,4),"mV";
#in dB
Vavgd=20*math.log10(Vavg*10**-3);
print"Vavg(in dBmV) =",round(Vavgd,4);
import math
#given
Voutp=20; #in dB
Pin=1.2; #in mW
m=0.035;
Vavg=10**(Voutp/20); #in
R=Vavg*math.sqrt(2)/Pin/m;
print"R =",round(R,4),"V/W";
import math
#given
Voutp=28.; #in dB
Pin=1; #in mW
R=800; #in V/W
Vavg=10**(Voutp/20); #in
m=Vavg*math.sqrt(2)/Pin/R;
print"The modulation depth ,m =",round(m*100,4),"percent";
import math
#given
Ipd=1.2; #in mA
m=0.04;
RINd=-160.; #in dB/Hz
e=1.6*10**-19;
nth=8; #in pA/Hz
BW=4; #in MHz
Rin=10**(RINd/10); #in
CNR=(0.5*(m*Ipd*10**-3)**2)/((2*e*Ipd*10**-3)+(Rin*Ipd*10**-3)**2+((nth*10**-12)**2)*BW/10**6);
print"Value of CNR=","{0:.3e}".format(CNR);
CNRdB=10*math.log10(CNR)
print"Value of CNR in dB=",round(CNRdB,4),"dB"
#Answer in the book is misprinted or wrong calculation performed in the book
import math
#given
L1=40; #in km
L2=100; #in km
A=0.2; #in dB/Km
TFA1=A*L1;
print"Total fibre span attenuation",round(TFA1,4),"dB";
TFA2=A*L2;
print"Total fibre span attenuation",round(TFA2,4),"dB";
nsd=TFA2-TFA1;
print"Noise spectral density =",round(nsd,4),"dB";
nsd_abs=10**(nsd/10)
print"Absolute value of noise spectral density =",round(nsd_abs,4),"dB";
import math
#given
P1=2.75; #in mW
NFd=5; #in dB
bw=5; #in GHz
G=10; #in dB
hv=1.6*10**-19; #photon energy in J
N=1; #no of amplifiers
NF=10**(NFd/10.); #amplifier noise figure
SNR=10*math.log10(P1*10**-3/(G*hv*bw*10**9*N*NF)); #signal to nois eratio
print"Spectral Noise density =",round(SNR,4),"dB";
import math
#given
SNRdB=40; #in dB
NFd=6; #in dB
bw=4; #in GHz
Gd=8; #in dB
hv=1.6*10**-19; #photon energy in J
N=8; #no of amplifiers
SNR=10**(SNRdB/10.);
NF=10**(NFd/10.); #amplifier noise figure
G=10**(Gd/10.); #amplifer gain
P1=10*(SNR/10.)*(G*hv*bw*10**9*N*NF)/10**-3; #optical power launched into fibre
print"Optical power required , Pl =",round(P1,4),"mW ";
import math
#given
l=1550; #wavelength in nm
fb=10; #system bit rate Gb/s
Df=17; #fiber dispersion in ps/nm-km
L=10**5/Df/fb**2; #fiber length in km
print"Transmission length is",round(L,4),"km";
fb2=2.5; #system bit rate Gb/s
print"for fb=2.5 Gb/s"
L2=10**5/Df/fb2**2; #fiber length in km
print"Transmission length is",round(L2,4),"km"; #answer misprint in book
import math
#given
lembda=1550; #wavelength in nm
Df=17; #fiber dispersion in ps/nm-km
L=80 #fiber length in km
fb=math.sqrt(10**5/Df/L)
print"Maximum bit rate fb =",round(fb,4),"Mb/s";
import math
#given
D=0.2; #dispersion constant in ps/nm/km
Tfwhm=18; #ps
Zs=0.25*Tfwhm**2/D; #Characteristic length
print" Zs =",Zs,"km"; #answer in book is miscalculated
import math
#given
lembda=1550; #wavelength in nm
c=3*10**5; #speed of light in km/s
Zs=600; #in km
Tfwhm=20; #in ps
D=1/1.763**2*(2*math.pi*c*Tfwhm**2/(lembda**2*Zs)); #dispersion constant
print"dispersion constant, D =",round(D,4),"ps/nm/km";
import math
#given
l=1557; #wavelength in nm
c=3*10**5; #speed of light in km/s
Zs=550; #in km
D=0.25; #in ps/nm/km
Tfwhm=math.sqrt(1.763**2*l**2*D*Zs/(2*math.pi*c)); #Soliton pulse width
print"Tfwhm =",round(Tfwhm,3),"ps";
import math
#given
Aeff=55; #in sq micrometer
l=1557; #wavelength in nm
c=3*10**5; #speed of light in km/s
n2=2.6*10**-16; #in cm**2/W
D=0.20; #Dispersion constant in ps/nm/km
Tfwhm=30; #in ps
Zs=(2*math.pi*c*Tfwhm**2/l**2/D)/(1.763)**2 ; #charecteristic length
print" Zs =",round(Zs,4),"km";
Ps=(Aeff*10**-12*l*10**-9)/(2*math.pi*n2*10**-4*Zs*10**3); #Peak pulse power
#Miscalculation in the book
print" Ps =",round(Ps*1000,4),"mW";
import math
#given
Z=10; #in mm
Tfwhm=22; #in ps
D=0.5; #ps/nm/km
Aeff=55; #in microm^2
A=0.05; #in km^-1
nsp=1.5; #spontaneous emission
F=2; #amplifier noise
s=3.6*10**3*nsp*F*A*D*Z**3/(Aeff*Tfwhm);
print" sigma =",round(s,4),"ps";
#answer in book is misprint
import math
#given
Q1=4; #quality factor
Q2=6; #quality factor
BER1=(2*math.pi*(Q1**2+2))**-0.5*math.e**(-Q1*Q1/2);
BER2=(2*math.pi*(Q2**2+2))**-0.5*math.e**(-Q2*Q2/2);
print"For Q=4 ,BER =","{0:.3e}".format(BER1);
print"For Q=6 ,BER =","{0:.3e}".format(BER2);
#Answer second is misprinted in the book
import math
#given
D=0.5; #Dispersion constant ps/nm/km
Ts=22; #Pulse width in ps
fb=10; #system transmission rate in Gb/s
Z1=1; #System total length Mm
Z2=10; #System total length Mm
sa1=8.6*D*D*Z1*Z1*math.sqrt(fb-0.99)/22/2; #standard deviation based on accoustic effect
sa2=8.6*D*D*Z2*Z2*math.sqrt(fb-0.99)/22/2; #standard deviation based on accoustic effect
print"For Z=1000km ,sigma acoustic =",round(sa1,4),"ps";
print"For Z=10000km ,sigma acoustic =",round(sa2,4),"ps ";
import math
#given
D=0.45; #dispersion coefficient in ps/nm/km
Ts=22; #Pulse width in ps
l=0.5; #length in nm
Lcollision=2*Ts/l/D; #collision length in km
print"Lcollision =",round(Lcollision,4),"km";
import math
#given
f=70; #Maximum frequencyshift in Ghz
Ts=22; #Pulse width in ps
CS=1.783*f*10**9*Ts*10**-12; #half channel seperation
print"The half channel seperation",round(CS,4);
df=0.105/f/10**9/Ts/Ts/10**-24; #maximum frequency shift
print"The maximum frequency shift",round(df/10**9,4),"GHz";
dt=0.1786/f/10**9/f/10**9/Ts/10**-12; #time displacement
print"The time displacement",round(dt*10**12,4),"ps";
import math
#given
M=1.;
N=1.; #no of collision
S1=4.; #soliton colllision
S2=5.; #soliton colllision
Nc=S1*S1/4*(M*S1/2-M+N); #minimum no of collision
print"Ncollision for S=4,is",Nc;
Nc2=(S2*S2-1)/4*(M*S2/2-M+N); #minimum no of collision
print"Ncollision for S=5,is",Nc2;
import math
#given
S=4.;
n=5;
print"Maximum number of solition Collisions";
for M in range(1,n+1):
N=M;
Nc=S*(M*S*S/3.+S*(N/2.-M)-N/2.+2*M/3.); #minimum no of collision
print" M=",M," N=",N," S=",S,"is",Nc;
import math
#given
M=1; #number of solition Collisions
N=1; # number of solition Collisions
x=2;
y=1./2;
p=3;
p2=4;
Tb=100; #ps
l=1; #difference in wavelength in nm
D=7*10**-2; #ps/nm**2*km
Zr=y*y*(Tb/l/l/D); #regeration spacing in km
print" Zr =",Zr,"km";
P=(p-1)*N+(p-2)*(p-1)*M/2.;
print" P(",p,") =",P; #result number of Collisions
P2=(p2-1)*N+(p2-2)*(p2-1)*M/2.;
print" P(",p2,") =",P2; #result number of Collisions
import math
#given
Tb=100; #bit period in ps
dZ=0.4; #in ps/nm/km
Zr=150; #Modulator spacing in km
Ta=Tb/(dZ*Zr); #channel spacing in nm
print"Channel spacing",round(Ta,4),"nm";
import math
#given
Zr=200; #Modulator spacing in km
D=0.6; #in ps/nm/km
l=2; #in nm
Tb=l*(Zr*D); #bit period in ps
print"Bit period Tb =",Tb,"ps";
import math
#given
D=0.5; #ps/nm-km
Tb=80; #bit period in ps
l=1.5; #in nm
Zr=Tb/(D*l); #Modulator spacing in km
print" Maximum modulator spacing Zr =",round(Zr,4),"km";
import math
#given
Zd=100; #in km
Do=0.07; #in ps/nm**2
D1=-0.3; #in ps/nm**2
Ldsf=(Zd*Do)/(Do-D1); #length of dispersion compensation fiber in km
print"Length of Dispersion compensation fiber, Ldsf =",round(Ldsf,4),"km";
import math
#given
m=3;
n=1;
Tb=100; #ps
l=1; #nm
D=0.07; #ps/nm**2*km
lmn=1; #nm
lmo=2; #nm
Do=0.1; #ps/nm-km
Lc=4*Tb/(5*D*lmn*(lmn+2*lmo)); #Collision length in km
print"Collision length without dispersion slope compensation =",round(Lc,4),"km";
Lc2=2*Tb/(5*Do*lmn); #Collision length in km
print"Collision length with dispersion slope compensation =",Lc2,"km";
import math
#given
Zr=200; #in km
S=4;
Ltot1=2*Zr*(S-1); #total solition collion length in km
print"Total solition Collisions length With DSC ,Ltotal =",round(Ltot1,4),"km";
Ltot2=(2./5)*Zr*(S-1); #total solition collion length in km
print"Total solition Collisions length With non-DSC ,Ltotal =",round(Ltot2,4),"km";