from __future__ import division
#Given data :
Eg=1.43 #in eV
T=300 #in kelvin
h=6.63*10**-34 #Planks constant
c=3*10**8 #speed of light in m/s
lamda_c=h*c/(Eg*1.6*10**-19) #in meter
print "Longest Wavelength cut-off= %0.f nm " %(lamda_c*10**9)
#Given data :
photons=6*10**12 #no. of incident photons
lamda=1330 #in nm
pairs=4.8*10**12 #no. of electron hole pairs generated
ETA=pairs/photons #Quantum efficiency (unitless)
ETA=ETA*100 #Quantum efficiency in %
print "Quantum efficiency = %0.f %% " %ETA
#Given data :
lamda=1300 #in nm
lamda=lamda*10**-9 #in meter
ETA=90 #quantum efficiency in %
h=6.63*10**-34 #Planks constant
q=1.6*10**-19 #in coulamb
c=3*10**8 #in m/s
R=(ETA/100)*q*lamda/(h*c) #in A/W
print "Responsivity of InGaAs = %0.2f A/W " %R
#Given data :
E=4.5*10**-21 #in Joule
R=0.9 #in A/W
P=20 #in uWatt
Ip=R*P #in uA
print "Photocurrent generated = %0.f micro Ampere" %Ip
#Given data :
ETA=65 #Quantum efficiency in %
lamda=900 #in nm
lamda=lamda*10**-9 #in meter
q=1.6*10**-19 #in coulamb
h=6.63*10**-34 #Planks constant
c=3*10**8 #in m/s
P=0.5 #in uWatt
Im=20 #in uA
Ip=(ETA/100)*q*P*lamda/(h*c) #in micro Ampere
M=Im/Ip #unitless
print "Multiplication Factor = %0.f" %M
#Note : Ans in the book is not accurate.
from math import pi
#Given data :
C_A=2 #in pF
C_D=5 #in pF
RL=50 #in Ohm
RA=1 #in KOhm
RA=1*10**3 #in Ohm
C=C_A+C_D #in pF
R=RA*RL/(RA+RL) #in Ohm
B=1/(2*pi*R*C*10**-12) #in Hz
print "Circuit Bandwidth of p-i-n photodiode = %0.f MHz " %(B*10**-6)
#Note : Ans in the book is not accurate.
#Given data :
ETA=40 #quantum efficiency in %
E=1.5 #in eV
Ip=3 #in uA
h=6.63*10**-34 #Planks constant
c=3*10**8 #in m/s
q=1.6*10**-19 #in coulamb
lamda=h*c/(E*1.6*10**-19) #in meter
print "Wavelength of photodiode = %0.f nm " %(lamda*10**9)
P=Ip*10**-6*(E*1.6*10**-19)/(ETA*q/100)
print "Power required = %0.2f micro Watts " %(P*10**6)
#Note : Ans in the book is not accurate.
#Given data :
photons=1600 #incident photons/sec
lamda=1.3 #in um
electrons=1100 #generated/sec
ETA=electrons/photons #unitless
q=1.6*10**-19 #in coulamb
h=6.63*10**-34 #Planks constant
c=3*10**8 #in m/s
R=ETA*q*lamda*10**-6/(h*c) #in A/W
print "Responsivity = %0.2f A/W " %R
#Given data :
C=1 #in pF
#Part (a) :
FH=1 #in MHz
R=1/((2*pi*FH*10**6*C)*10**-12) #in ohm
print "(a) For 1 MHz, Maximum Load Resistnce = %0.f kohm " %(R*10**-3)
#Part (b) :
FH=1 #in GHz
R=1/((2*pi*FH*10**9*C)*10**-12) #in ohm
print "(b) For 1 GHz, Maximum Load Resistnce = %0.f ohm" %R
from math import sqrt, pi
#Given data :
lamda=1.3 #in um
lamda=lamda*10**-6 #in meter
Id=8 #in nA
ETA=55 #in %
h=6.63*10**-34 #Planks constant
c=3*10**8 #in m/s
q=1.6*10**-19 #in coulamb
NEP=(h*c)*sqrt(2*q*Id*10**-9)/((ETA/100)*q*lamda) #in Ohm
print "NEP for Si p-i-n photodiode = %0.1e ohm " %NEP
#Given data :
A=2.5 #in mm**2
A=A*10**-6 #in m**2
B=1 #in KHz
B=B*10**3 #in Hz
Dstar=10**11 #mHz**1/2W**-1
NEP=sqrt(A*B)/Dstar #in Watts
print "Smallest detectable signal power = %0.1f pW "%(NEP*10**12)
#Given data :
A=200*25 #in um**2
A=A*10**-12 #in m**2
ETA=55 #Quantum Efficiency in %
lamda=1.3 #in um
lamda=lamda*10**-6 #in meter
Id=8 #in nA
Id=Id*10**-9 #i Ampere
h=6.63*10**-34 #Planks constant
q=1.6*10**-19 #in coulamb
c=3*10**8 #in m/s
NEP=h*c*sqrt(2*q*Id)/((ETA/100)*q*lamda) #in Watts
print "Noise equivalent power = %0.e Watts " %(NEP)
Dstar=sqrt(A)/NEP #in m-Hz**2/W**-1
print "Specific detectivity of Ge p-i-n photodiode = %0.e m-Hz^(1/2)-W^-1 " %Dstar
#Note : Answer in the bok is not accurate.
#Given data :
C=6 #in pF
C=C*10**-12 #in F
FH=8 #in MHz
FH=FH*10**6 #in Hz
#Formula : FH=1/(2*pi*R*C)
R=1/(2*pi*FH*C) #in Ohm
print "Maximum load resistance = %0.1f kohm" %(R*10**-3)
#Given data :
lamda=0.9 #in um
lamda=lamda*10**-6 #in meter
ETA=60 #Quantum Efficiency in %
Id=3 #in nA
Id=Id*10**-9 #in Ampere
B=5 #in MHz
P=200 #in nW
P=P*10**-9 #in Watts
h=6.63*10**-34 #Planks constant
q=1.6*10**-19 #in coulamb
c=3*10**8 #in m/s
Ip=P*(ETA/100)*q*lamda/(h*c) #in Ampere
#Formula : Is**2=2*q*(Ip+Id)*B
Is=sqrt(2*q*(Ip+Id)*B*10**6) #in Ampere
print "Total shot noise current = %0.2f nA " %(Is*10**9)
from math import floor
#Given data :
lamda=1.35 #in um
lamda=lamda*10**-6 #in meter
ETA=40 #Quantum Efficiency in %
Im=4.9 #in uA
Im=Im*10**-6 #in Ampere
P=0.2 #/in uW
P=P*10**-6 #in watts
h=6.63*10**-34 #Planks constant
q=1.6*10**-19 #in coulamb
c=3*10**8 #in m/s
M=Im*h*c/((ETA/100)*q*P*lamda) #unitless
print "Multiplication factor = %0.f " %(floor(M))
#Given data :
photons=10**13 #incident photons/sec
E=1.28*10**-19 #in Joule
h=6.63*10**-34 #Planks constant
q=1.6*10**-19 #in coulamb
c=3*10**8 #in m/s
#Part (a) :
lamda=h*c/(E) #in meter
print "(a) Wavelength of incident radiation = %0.2f micro meter" %(lamda*10**6)
#Part (b) :
Ip=q*photons #in Ampere
print "(b) Output photocurrent = %0.2f micro Ampere" %(Ip*10**6)
#Part (c) :
M=18 #unitless
Im=M*Ip #in Ampere
print "(c) If device is an APD, Output photocurrent = %0.1f micro Ampere" %(Im*10**6)
#Given data :
M=20 #unitless
lamda=1.5 #in um
lamda=lamda*10**-6 #in meter
R=0.6 #in A/W
h=6.63*10**-34 #Planks constant
q=1.6*10**-19 #in coulamb
c=3*10**8 #in m/s
photons=10**10 #incident photons/sec
Im=M*R*photons*h*c/lamda #in Ampere
print "Output Photo current = %0.1f nA " %(Im*10**9)
ETA=R*h*c/(q*lamda) #unitless
print "Quantum Efficiency = %0.f %%" %(round(ETA*100))
from numpy import log10
#Given data :
RL=630 #in Ohm
B=50 #in MHz
B=B*10**6 #in Hz
Ip=10**-7 #in Ampere
T=18 #in degree C
T=T+273 #in kelvin
q=1.6*10**-19 #in coulamb
K=1.38*10**-23 #Boltzman Constant
SbyN=Ip**2/(2*q*B*Ip+4*K*T*B/RL) #unitless
SbyNdB=10*log10(SbyN) #in dB
print "Maximum SNR = %0.f dB " %round(SbyNdB)
#Given data :
lamda=1.3 #in um
lamda=lamda*10**-6 #in meter
Id=16 #in nA
Id=Id*10**-9 #in Ampere
ETA=90 #Quantum Efficiency in %
RL=1000 #in Ohm
P=1.2 #in uW
P=P*10**-6 #in Watts
B=80 #in Mhz
B=B*10**6 #in Hz
T=20 #in degree C
T=T+273 #in kelvin
q=1.6*10**-19 #in c
K=1.38*10**-23 #Boltzman Constant
h=6.63*10**-34 #Planks constant
c=3*10**8 #in m/s
Ip=(ETA/100)*q*lamda*P/(h*c) #in Ampere
Iq=sqrt(2*q*Ip*B) #in Ampere
print "Mean square quantum noise = %0.2f nA " %(Iq*10**9)
I_dark=sqrt(2*q*Id*B) #in Ampere
print "Mean square dark current noise = %0.2f nA "%(I_dark*10**9)
It=sqrt(4*K*T*B/RL) #in Ampere
print "Mean square thermal current noise = %0.f nA " %round(It*10**9)
#Given data :
F=3 #in dB
F=10**(F/10) #unitless
M=1 #unitless
lamda=1.3 #in um
lamda=lamda*10**-6 #in meter
Id=16 #in nA
Id=Id*10**-9 #in Ampere
ETA=90 #Quantum Efficiency in %
RL=1000 #in Ohm
P=1.2 #in uW
P=P*10**-6 #in Watts
B=80 #in Mhz
B=B*10**6 #in Hz
T=20 #in degree C
T=T+273 #in kelvin
q=1.6*10**-19 #in c
K=1.38*10**-23 #Boltzman Constant
h=6.63*10**-34 #Planks constant
c=3*10**8 #in m/s
Ip=(ETA/100)*q*lamda*P/(h*c) #in Ampere
SbyN=Ip**2*M**2/(2*q*B*(Ip+Id)*M**2+(4*K*T*B*F/RL))
print "SNR at the output = %0.f "%SbyN
# Answer is not accurate in the textbook.