import math
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
from scipy import special
%matplotlib inline
#variable declaration
sigma = 1 #pulse width
#calculation
fdB_optical = 0.187/sigma
fdB_electrical = 0.133/sigma
#result
print "F_dB Optical =",fdB_optical
print "F_dB Electrical =",fdB_electrical
#plot
t = arange(-3.0, 3.0, 0.1)
p = (1/(sigma*sqrt(2*pi)))*exp((-t**2)/(2*(sigma**2)))
plot(t,p)
ylabel('Relative pulse amplitude P(t)')
xlabel('Time t')
title('Definations of pulse shape parameters')
text(-0.7,0.25,'RMS pulse width')
text(-1.0,0.20,'Full width half maximum')
text(-0.5,0.15,'1/e width')