In [84]:
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import fft, ifft, fftshift
%matplotlib inline

In [111]:
t = np.linspace(-1000,1000,num=2**12)
print "Size of time array:", np.shape(t)[0]
c = 3e8 # speed of light


Size of time array: 4096

In [119]:
A0 = 1.0
w = 100.0
A = A0*np.exp(-t**2/w)

In [120]:
plt.plot(t,A)


Out[120]:
[<matplotlib.lines.Line2D at 0x10c830310>]

In [121]:
w0 = 2*np.pi*383e12
scanwidth = 2*np.pi*1e10 # in GHz
detuning = 1e9
wcenter = w0 + detuning
w = np.linspace(wcenter - scanwidth,wcenter + scanwidth,num=2**12)
gamma = 2*np.pi*1e8
dn_max = 0.1
nreal = 1 + dn_max * 2*(w0 - w)*gamma/( (w0 - w)**2 + gamma**2)
nimag = dn_max * (gamma**2)/( (w0 - w)**2 + gamma**2)
phaseindex = 1 - nreal
absorption = nimag

In [128]:
plt.plot(w/detuning,absorption)
plt.plot(w/detuning,phaseindex)


Out[128]:
[<matplotlib.lines.Line2D at 0x10cf8ead0>]

In [123]:
k = w*(nreal + 1j*nimag)/c
L = 0.075  # length of medium

In [124]:
output = ifft(fft(A)*np.exp(1j*k*L))

In [125]:
plt.plot(t,output)


Out[125]:
[<matplotlib.lines.Line2D at 0x10ccb1c10>]

In [ ]: