### pypho v3

#### Example 2: Intersymbol interference by chromatic dispersion

A good estimation to calculate the maximum reach limited by chromatic dispersion can be calculated by using the formular of pulse broadening:
$$T_{max} = T(z=0) \sqrt{1 + \left( \frac{z}{L_D} \right)^2} = T(z=0) \sqrt{1 + \left( \frac{z |\beta_2|}{T_0^2} \right)^2}$$

In the definition of the dispersion length $L_D = T_0^2 / |\beta_2|$ the parameter $T_0$ represents the 1/e pulse width of the electrical field (see example 1). $T_{max}$ is the maximum FWHM pulse width of a gaussian pulse concerning the optical power and $T(z=0)$ the FWHM pulse width of the initial pulse befor the transmission fiber.

To generalize the formular the pulse widths are normalized to the symbol rate $1/T_{symbol}$: $T(z=0) = \tau(z=0)* T_{symbol}$ and $T_{max} = \tau_{max} * T_{symbol}$ , where $0 < \tau(z=0) < 1$ and $\tau_{max} > \tau(z=0)$.

Recalculating the 1/e pulswidth $T_0 = T(z=0)/1.66510 = \tau(z=0)*T_{symbol}/1.66510$ and solving the equation for $z$ results in the maximum transmission distance: $$z_{max} = \left(\frac{T_{symbol}}{1.665095}\right)^2 \tau(z=0)\sqrt{\tau_{max}^2 - \tau(z=0)^2} \frac{2\pi c}{D \lambda_0^2 }$$

The example below shows the eye diagram of a single pulse with a symbolrate $T_{symbol}= 1/10^{9}s$ and a FWHM pulse width of $T(z=0)= 36ps$. Setting the maximum pulswidth to $T_{max} = T_{symbol}$ ($\tau_{max}=1$) and assuming a fiber with a dispersion coefficient of $D=16.8ps /(nm km)$ the maximum reach is $z=56.53km$.

As can be seen in the eye diagram the FWHM pulse width of the output signal is equals as the symbolrate $T_{symbol}$. Here only a single pulse is used to show the effect of pulse broadening without any inter symbol interference.

$\tau_{max} = 1$ is very aggresive and should be set to about 0.75 .

Fig. 1 : Input and broadened output signal

Fig. 2 and Fig. 3 show the eyediagramme of sognal with different FWHM puls widths after the maximum transmission distance $z_{max}$. As can be seen the eyes looks different, although in both cases the maximum pulse width is set to $\tau_{max}=0.75$. The eye opening penalty is different. This means that the formular is only an estimation of the maximum transmission distance.

Fig. 2 : Eye diagramme for $\tau(z=0)=0.25$ and $z=29.75km$.

Fig. 3 : Eye diagramme for $\tau(z=0)=0.50$ and $z=47.05km$.

##!/usr/bin/env python2
# -*- coding: utf-8 -*-

#Import functions and libraries
import sys
sys.path.append('../')
from pypho_setup import pypho_setup
from pypho_symbols import pypho_symbols
from pypho_signalsrc import pypho_signalsrc
from pypho_lasmod import pypho_lasmod
from pypho_fiber import pypho_fiber
from pypho_eye import pypho_eye
from pypho_functions import *
import numpy as np
import copy
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
from scipy.interpolate import UnivariateSpline

# Define some parameter
T_FWHM = 50e-12       # FWHM-pulsewidth of the optical power
T_e = T_FWHM / 1.66510  # 1/e-pulsewidth of the electrical field
z = 29.756e3         # Fiber length
D = 16.8                # Dispersion coefficient
T_FWHM_norm_max = 0.75   # Maximum FWHM pulseiwdth of the

# Define network elements
gp       = pypho_setup(nos = 4*16, sps = 1*256, symbolrate = 10e9)
bitsrc   = pypho_symbols(glova = gp, nos = gp.nos, pattern = 'random') # Set pattern = "singlepulse"
esigsrc  = pypho_signalsrc(glova = gp, pulseshape = 'gauss_rz' , fwhm = T_FWHM*gp.symbolrate)
sig_1550 = pypho_lasmod(glova = gp, power = 0, Df = 0, teta = 0)
SSMF     = pypho_fiber(glova = gp, l = z,  D = D,   S = 0, alpha = 0.2e-12, gamma = 0, phi_max = 10.0)
eye      = pypho_eye(glova = gp, polarisation = 'x,y')

# Simulation
bits = bitsrc()

esig = esigsrc(bitsequence = bits)
E_Tx = sig_1550(esig = esig)

E = copy.deepcopy(E_Tx)

# Fiber trannsmission
E = SSMF(E = E)
E[0]['E'][0] = E[0]['E'][0] /np.max(np.abs(E[0]['E'][0]))*1e-3
E_Tx[0]['E'][0] = E_Tx[0]['E'][0] /np.max(np.abs(E_Tx[0]['E'][0]))*1e-3
# Plot Input and Output signal
beta_2, beta_3 = DS2beta(D, 0, gp.lambda0)
L_D = (T_e)**2  / np.abs(beta_2)     # Pulse width T_e here of the electrical field

plt.figure(1)
eye(E = E_Tx[0]['E'], polarisation = 'x', style="r")
eye(E = E[0]['E'], polarisation = 'x', style="g")

red_patch = mpatches.Patch(color='red', label='Input signal')
green_patch = mpatches.Patch(color='green', label='Output signal')
plt.legend(handles=[red_patch, green_patch], loc=1); plt.show()

print ('Calculated output FWHM-pulse width : T_FWHM,1 = ' , T_FWHM * np.sqrt(1 + (z/L_D)**2)*1e12, ' ps')
T_FWHM_norm_0 = T_FWHM*1e12 / 100.0
print (  'Calculated max reach : ' , 100e-12**2 *(1/1.665095)**2 * 2.0*np.pi * 299792458 *  T_FWHM_norm_0*np.sqrt(  T_FWHM_norm_max**2 - T_FWHM_norm_0**2) / (16.8e-6 * 1550e-9**2 )  *1e-3 )