Commit 6ff1d16d authored by hm-striegle's avatar hm-striegle

Example 6 added - XPM

parent 0dac22b0
......@@ -20,24 +20,24 @@ import matplotlib.pyplot as plt
# Define network elements
gp = pypho_setup(nos = 4*16, sps = 1*128, symbolrate = 10e9)
gp = pypho_setup(nos = 8, sps = 256, symbolrate = 10e9)
bitsrc = pypho_bits(glova = gp, nob = gp.nos, pattern = 'singlepulse') # Set pattern = "singlepulse"
esigsrc = pypho_signalsrc(glova = gp, pulseshape = 'gauss_rz' , fwhm = 0.33)
sig_f0 = pypho_cwlaser(glova = gp, power = 3, Df = 0, teta = 1*np.pi/4.0)
sig_f1 = pypho_lasmod(glova = gp, power = 0, Df = 500, teta = 1*np.pi/1.0)
filter_f0 = pypho_optfi(glova = gp, Df = 0, B = 50)
SSMF = pypho_fiber(glova = gp, l = 80, D = 9.0, S = 0.0, alpha = 0.2, gamma = 1.4, phi_max = .1)
sig_f0 = pypho_cwlaser(glova = gp, power = -20, Df = 0, teta =1*np.pi/4.0)
sig_f1 = pypho_lasmod(glova = gp, power = -10, Df = 500, teta = 0*np.pi/1.0)
filter_f0 = pypho_optfi(glova = gp, Df = 0, B = 150)
SSMF = pypho_fiber(glova = gp, l = 10e3, D = 0.0, S = 0.0, alpha = 0.2, gamma = 1.4, phi_max = .001)
# Simulation
# Define wavelength channel
# Define wavelength channels
E_f0 = sig_f0()
E_f0 = sig_f0()
bits = bitsrc()
esig = esigsrc(bitsequence = bits)
E_f1 = sig_f1(esig = esig)
E = copy.deepcopy(E_f1)
E_f1 = sig_f1(esig = esig)
E = copy.deepcopy(E_f1)
E[0]['E'][0] = E_f0[0]['E'][0] + E_f1[0]['E'][0] # Multiplex all signals X-Pol
E[0]['E'][1] = E_f0[0]['E'][1] + E_f1[0]['E'][1] # Multiplex all signals Y-Pol
......@@ -47,20 +47,20 @@ E_Tx = copy.deepcopy(E)
# Plot Spectrum Input signals
plt.figure(1)
plt.subplot(2, 1, 1)
plt.plot((gp.freqax-gp.f0)*1e-9, np.log10(abs(fftshift(fft(E[0]['E'][0] )**2))), 'r')
plt.plot((gp.freqax-gp.f0)*1e-9, np.log10(abs(fftshift(fft(E[0]['E'][1] )**2))), 'g:')
plt.plot((gp.freqax-gp.f0)*1e-9, np.log10(abs(fftshift(fft(E[0]['E'][0] )**2))), 'r', label='X-Pol')
plt.plot((gp.freqax-gp.f0)*1e-9, np.log10(abs(fftshift(fft(E[0]['E'][1] )**2))), 'g:', label='Y-Pol')
plt.title("Input spectrum", loc='left')
plt.ylabel('Spec. density');
plt.grid(True)
plt.legend()
# Fiber transmission
E = SSMF(E = E)
# Plot Spectrum Output signals
plt.subplot(2, 1, 2)
plt.plot((gp.freqax-gp.f0)*1e-9, np.log10(abs(fftshift(fft(E[0]['E'][0] )**2))), 'r')
plt.plot((gp.freqax-gp.f0)*1e-9, np.log10(abs(fftshift(fft(E[0]['E'][1] )**2))), 'g:')
plt.plot((gp.freqax-gp.f0)*1e-9, np.log10(abs(fftshift(fft(E[0]['E'][0] )**2))), 'r', label='X-Pol')
plt.plot((gp.freqax-gp.f0)*1e-9, np.log10(abs(fftshift(fft(E[0]['E'][1] )**2))), 'g:', label='Y-Pol')
plt.title("Output spectrum", loc='left')
plt.ylabel('Spec. density'); plt.xlabel('Frequency deviation [GHz]');
plt.grid(True)
......@@ -68,23 +68,39 @@ plt.grid(True)
# Calculate phase shift
L_eff = (1-np.exp(-SSMF.l*SSMF.alpha))/(SSMF.alpha)
phi_x_max = - (np.max(np.abs(E_Tx[0]['E'][0])**2) + 2.0/3.0* np.max(np.abs(E_Tx[0]['E'][1])**2))* L_eff * SSMF.gamma *1e-3
phi_y_max = - (np.max(np.abs(E_Tx[0]['E'][1])**2) + 2.0/3.0* np.max(np.abs(E_Tx[0]['E'][0])**2))* L_eff * SSMF.gamma *1e-3
phi_XPM_x_max = - 2*(np.max(np.abs(E_f1[0]['E'][0])**2) + 2.0/3.0* np.max(np.abs(E_f1[0]['E'][1])**2))* L_eff * SSMF.gamma *1e-3
phi_XPM_y_max = - 2*(np.max(np.abs(E_f1[0]['E'][1])**2) + 2.0/3.0* np.max(np.abs(E_f1[0]['E'][0])**2))* L_eff * SSMF.gamma *1e-3
phi_SPM_x_max = - (np.max(np.abs(E_f0[0]['E'][0])**2) + 2.0/3.0* np.max(np.abs(E_f0[0]['E'][1])**2))* L_eff * SSMF.gamma *1e-3
phi_SPM_y_max = - (np.max(np.abs(E_f0[0]['E'][1])**2) + 2.0/3.0* np.max(np.abs(E_f0[0]['E'][0])**2))* L_eff * SSMF.gamma *1e-3
print 'L_eff = ', L_eff
print 'phi_x_max = ', phi_x_max
print 'phi_y_max = ', phi_y_max
print 'phi_XPM_x_max = ', phi_XPM_x_max
print 'phi_XPM_y_max = ', phi_XPM_y_max
print 'phi_SPM_x_max = ', phi_SPM_x_max
print 'phi_SPM_y_max = ', phi_SPM_y_max
print 'phi_x_max = phi_XPM_x_max + phi_SPM_x_max', phi_XPM_x_max + phi_SPM_x_max
print 'phi_y_max = phi_XPM_y_max + phi_SPM_y_max', phi_XPM_y_max + phi_SPM_y_max
# Plot power of both pol axis as function of transmission distance
E = filter_f0(E)
plt.figure(2)
plt.subplot(2, 1, 2)
plt.ylabel('$10log |E_y|^2$'); plt.xlabel('Transmission distance [m]');
plt.ylim((-120, 10))
plt.grid(True)
plt.subplot(2, 1, 1)
plt.ylabel('$10log |E_y|^2$');
plt.ylim((-120, 10))
plt.ylabel('$|E|^2$'); plt.xlabel('Transmission distance [m]');
plt.plot(gp.timeax*1.0e12, np.abs(E_f1[0]['E'][0])**2, 'r', label='$E_x Pulse$')
plt.plot(gp.timeax*1.0e12, np.abs(E_f1[0]['E'][1])**2, 'g', label='$E_y Pulse$')
plt.plot(gp.timeax*1.0e12, np.abs(E_f0[0]['E'][0])**2, 'r:', label='$E_x cw@1550nm$')
plt.plot(gp.timeax*1.0e12, np.abs(E_f0[0]['E'][1])**2, 'g:', label='$E_y cw@1550nm$')
plt.grid(True)
plt.legend()
plt.subplot(2, 1, 2)
plt.plot(gp.timeax*1.0e12, np.angle(E[0]['E'][0]), 'r', label='$E_x$')
plt.plot(gp.timeax*1.0e12, np.angle(E[0]['E'][1]), 'g', label='$E_y$')
plt.ylabel('$phase(E_x)$');
plt.grid(True)
plt.show()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment