import math
from __future__ import division
#initialisation of variables
optical_power=10*10**-6; #optical power in W
R=0.5; #Responsivity in A/W
Is=optical_power*R; #shot noise current in A
Id=2*10**-9; #dark current in A
Rl=1e6; #Load resistance in ohm
B=1e6; #bandwidth in Hz
T=300; #Temperature in K
#CALCULATIONS
K=1.38*10**-20; #Boltzman constant in m2 g s-2 K-1
q=1.609*10**-19; #charge of a electron in Coulombs
Ith=4*K*T*B/Rl; #Mean Square Thermal noise current in A
SNR=(Is**2)/(2*q*(Is+Id)+Ith); #Signal to noise ratio
#RESULTS
print"Thermal noise current=",Ith*10**18,"*10^-18A";
print"Shot noise current=",Is*10**6,"*10^-6A";
print"Signal to noise ratio=",round(10*math.log10(SNR),5),"dB"; #The answers vary due to round off error
import math
from __future__ import division
#initialisation of variables
eta=0.6; #quantum efficiency
Po=10*10**-6; #optical power in W
q=1.6*10**-19; #charge of an elctron in columb
lambda1=0.85*10**-6; #wavelength in m
h=6.6*10**-34; #planck's constant
c=3*10**8; #velocity of light in m/s
Rl=50; #load Resistance in ohm
#CALCULATIONS
R=(q*eta*lambda1)/(h*c); #responsivity in A/W
I=R*Po; #current in A
V=Rl*I; #Voltage in V
#RESULTS
print"Responsivity=",round(R,5);
print"Current=",round(I*10**6,5),"uA"; #multiplication by 1e6 to convert unit from A to uA
print"Voltage=",round(V*10**3,5),"mV"; #multiplication by 1e6 to convert unit from V to mV
import math
from __future__ import division
#initialisation of variables
tau_tr=2*1e-9; #transit time in sec
Rl=50; #load resistance in ohm
Cd=3*1e-12; #Junction capacitance in farad
#CALCULATIONS
tau=2*Rl*Cd; #Circuit time constant in sec
f3dB=(0.35/tau_tr); #3dB bandwidth in Hz
#RESULTS
print"Circuit time constant =",round(tau*1e9,5),"ns"; #multiplication by 1e9 to convert unit from s to ns
print"3dB bandwidth=",round(f3dB*1e-6,5),"MHz"; #multiplication by 1e-6 to convert unit from Hz to MHz
import math
from __future__ import division
#initialisation of variables
I=100*1e-9; #current in A
P=5*1e-9; #Incident power in W
h=6.6*10**-34; #planck's constant
c=3*10**8; #velocity of light in m/s
q=1.6*10**-19; #charge of an elctron in columb
eta=0.7; #quantum efficiency
#CALCULATIONS
lambda1=1.5*10**-6; #wavelength in m
R=I/P; #APD responsivity in A/W
M= (R*h*c)/(q*eta*lambda1); #Multiplication factor
#RESULTS
print"Responsivity=",round(R,5);
print"Multiplication factor=",round(M,5);
import math
from __future__ import division
#initialisation of variables
h=6.6*10**-34; #planck's constant
c=3*10**8; #velocity of light in m/s
q=1.6*10**-19; #charge of an elctron in columb
lambda1=0.85*10**-6; #//wavelength in m
I=0.1; #incident light intensity in mW/mm2
Iph1=10*1e-6; #photocurrent in pin in A
Iph2=500*1e-6; #photocurrent in APD in A
A=0.2; #detector area in mm2
#CALCULATIONS
P=I*A; #Power seen by detector in mW
photons_generated=P*1e-3/(h*c/lambda1); #photons Generated
Rate=Iph1/q; #rate of carrier generation for pin
eta=Rate/photons_generated; #Quantum efficiency for pin
M=Iph2/Iph1; #Multiplication factor
#RESULTS
print"Quantum efficiency is=",round(eta,5); #The answers vary due to round off error
print"Avalanche multiple factor=",round(M,5);