mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-11-02 02:57:52 +00:00
Add NLI Evaluation in Fiber class (#33)
* Add Travis-CI configuration for continous integration * Add GN-Model Documentation and auto-doc integration * Add GN model to Fiber * Unit of measure conversion adapted to SI
This commit is contained in:
@@ -1 +1,9 @@
|
||||
language: python
|
||||
python:
|
||||
- "3.6"
|
||||
# command to install dependencies
|
||||
install:
|
||||
- pip install -r requirements.txt
|
||||
# command to run tests
|
||||
script:
|
||||
- pytest
|
||||
|
||||
@@ -3,8 +3,7 @@ gnpy
|
||||
====
|
||||
|
||||
|
||||
|docs|
|
||||
|
||||
|docs| |build|
|
||||
|
||||
Gaussian Noise (GN) modeling library
|
||||
|
||||
@@ -52,3 +51,8 @@ The key to unbundling is the ability to accurately plan and predict the performa
|
||||
:target: http://gnpy.readthedocs.io/en/develop/?badge=develop
|
||||
:alt: Documentation Status
|
||||
:scale: 100%
|
||||
|
||||
.. |build| image:: https://travis-ci.org/mcantono/gnpy.svg?branch=develop
|
||||
:target: https://travis-ci.org/mcantono/gnpy
|
||||
:alt: Build Status
|
||||
:scale: 100%
|
||||
|
||||
1850
docs/biblio.bib
Normal file
1850
docs/biblio.bib
Normal file
File diff suppressed because it is too large
Load Diff
19
docs/conf.py
19
docs/conf.py
@@ -17,10 +17,9 @@
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
# import os
|
||||
# import sys
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('../'))
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
@@ -33,7 +32,7 @@
|
||||
# ones.
|
||||
extensions = ['sphinx.ext.autodoc',
|
||||
'sphinx.ext.mathjax',
|
||||
'sphinx.ext.githubpages']
|
||||
'sphinx.ext.githubpages','sphinxcontrib.bibtex']
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
@@ -41,8 +40,8 @@ templates_path = ['_templates']
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
#
|
||||
# source_suffix = ['.rst', '.md']
|
||||
source_suffix = '.rst'
|
||||
source_suffix = ['.rst', '.md']
|
||||
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
@@ -85,7 +84,11 @@ todo_include_todos = False
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = 'default'
|
||||
on_rtd = os.environ.get('READTHEDOCS') == 'True'
|
||||
if on_rtd:
|
||||
html_theme = 'default'
|
||||
else:
|
||||
html_theme = 'alabaster'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
|
||||
124
docs/gn_model.rst
Normal file
124
docs/gn_model.rst
Normal file
@@ -0,0 +1,124 @@
|
||||
The QoT estimation in the PSE framework of TIP-OOPT
|
||||
=======================================================
|
||||
|
||||
QoT-E including ASE noise and NLI accumulation
|
||||
----------------------------------------------
|
||||
|
||||
The operations of PSE simulative framework are based on the capability to estimate the QoT of one
|
||||
or more channels operating lightpaths over a given network route. For
|
||||
backbone transport networks, we can suppose that transceivers are
|
||||
operating polarization-division-multiplexed multilevel modulation
|
||||
formats with DSP-based coherent receivers, including equalization. For
|
||||
the optical links, we focus on state-of-the-art amplified and
|
||||
uncompensated fiber links, connecting network nodes including ROADMs,
|
||||
where add and drop operations on data traffic are performed. In such a
|
||||
transmission scenario, it is well accepted
|
||||
:cite:`vacondio_nonlinear_2012,bononi_modeling_2012,carena_modeling_2012,mecozzi_nonlinear_2012,secondini_analytical_2012,johannisson_perturbation_2013,dar_properties_2013,serena_alternative_2013,secondini_achievable_2013,poggiolini_gn-model_2014,dar_accumulation_2014,poggiolini_analytical_2011,savory_approximations_2013,bononi_single-_2013,johannisson_modeling_2014`
|
||||
to assume that transmission performances are limited by the amplified
|
||||
spontaneous emission (ASE) noise generated by optical amplifiers and and
|
||||
by nonlinear propagation effects: accumulation of a Gaussian disturbance
|
||||
defined as nonlinear interference (NLI) and generation of phase noise.
|
||||
State-of-the-art DSP in commercial transceivers are typically able to
|
||||
compensate for most of the phase noise through carrier-phase estimator
|
||||
(CPE) algorithms, for modulation formats with cardinality up to 16, per
|
||||
polarization state
|
||||
:cite:`poggiolini_recent_2017,schmidt_experimental_2015,fehenberger_experimental_2016`.
|
||||
So, for backbone networks covering medium-to-wide geographical areas, we
|
||||
can suppose that propagation is limited by the accumulation of two
|
||||
Gaussian disturbances: the ASE noise and the NLI. Additional impairments
|
||||
such as filtering effects introduced by ROADMs can be considered as
|
||||
additional equivalent power penalties depending on the ratio between the
|
||||
channel bandwidth and the ROADMs filters and the number of traversed
|
||||
ROADMs (hops) of the route under analysis. Modeling the two major
|
||||
sources of impairments as Gaussian disturbances, and being the receivers
|
||||
*coherent*, the unique QoT parameter determining the bit error rate
|
||||
(BER) for the considered transmission scenario is the generalized
|
||||
signal-to-noise ratio (SNR) defined as
|
||||
|
||||
.. math::
|
||||
|
||||
{\text{SNR}}= L_F \frac{P_{\text{ch}}}{P_{\text{ASE}}+P_{\text{NLI}}} = L_F \left(\frac{1}{{\text{SNR}}_{\text{LIN}}}+\frac{1}{{\text{SNR}}_{\text{NL}}}\right)^{-1}
|
||||
|
||||
|
||||
where :math:`P_{\text{ch}}` is the channel power,
|
||||
:math:`P_{\text{ASE}}` and :math:`P_{\text{NLI}}` are the power levels of the disturbances
|
||||
in the channel bandwidth for ASE noise and NLI, respectively.
|
||||
:math:`L_F` is a parameter assuming values smaller or equal than one
|
||||
that summarizes the equivalent power penalty loss such as
|
||||
filtering effects. Note that for state-of-the art equipment, filtering
|
||||
effects can be typically neglected over routes with few hops
|
||||
:cite:`rahman_mitigation_2014,foggi_overcoming_2015`.
|
||||
|
||||
|
||||
To properly estimate :math:`P_{\text{ch}}` and :math:`P_{\text{ASE}}`
|
||||
the transmitted power at the beginning of the considered route must be
|
||||
known, and losses and amplifiers gain and noise figure, including their
|
||||
variation with frequency, must be characterized. So, the evaluation of
|
||||
:math:`{\text{SNR}}_{\text{LIN}}` *just* requires an accurate
|
||||
knowledge of equipment, which is not a trivial aspect, but it is not
|
||||
related to physical-model issues. For the evaluation of the NLI, several
|
||||
models have been proposed and validated in the technical literature
|
||||
:cite:`vacondio_nonlinear_2012,bononi_modeling_2012,carena_modeling_2012,mecozzi_nonlinear_2012,secondini_analytical_2012,johannisson_perturbation_2013,dar_properties_2013,serena_alternative_2013,secondini_achievable_2013,poggiolini_gn-model_2014,dar_accumulation_2014,poggiolini_analytical_2011,savory_approximations_2013,bononi_single-_2013,johannisson_modeling_2014`.
|
||||
The decision about which model to test within the PSE activities was
|
||||
driven by requirements of the entire PSE framework:
|
||||
|
||||
i. the model must be *local*, i.e., related individually to each network element (i.e. fiber span) generating NLI, independently of preceding and subsequent elements; and
|
||||
ii. the related computational time must be compatible with interactive operations.
|
||||
|
||||
So, the choice fell on the Gaussian Noise
|
||||
(GN) model with incoherent accumulation of NLI over fiber spans
|
||||
:cite:`poggiolini_gn-model_2014`. We implemented both the
|
||||
exact GN-model evaluation of NLI based on a double integral (Eq. (11) of
|
||||
:cite:`poggiolini_gn-model_2014`) and its analytical
|
||||
approximation (Eq. (120-121) of
|
||||
:cite:`poggiolini_analytical_2011`). We performed several
|
||||
validation analyses comparing results of the two implementations with
|
||||
split-step simulations over wide bandwidths
|
||||
:cite:`pilori_ffss_2017`, and results clearly showed that
|
||||
for fiber types with chromatic dispersion roughly larger than 4
|
||||
ps/nm/km, the analytical approximation ensures an excellent accuracy
|
||||
with a computational time compatible with real-time operations.
|
||||
|
||||
|
||||
|
||||
The Gaussian Noise Model to evaluate the NLI
|
||||
--------------------------------------------
|
||||
As previously stated, fiber propagation of multilevel modulation formats relying on the polarization-division-multiplexing
|
||||
generates impairments that can be summarized as a disturbance called nonlinear interference (NLI),
|
||||
when exploiting a DSP-based coherent receiver, as in all state-of-the-art equipment.
|
||||
From a practical point of view, the NLI can be modeled as an additive
|
||||
Gaussian random process added by each fiber span, and whose strength depends on the cube of the input power spectral density and
|
||||
on the fiber-span parameters.
|
||||
|
||||
Since the introduction in the market in 2007 of the first transponder based on such a transmission technique, the scientific
|
||||
community has intensively worked to define the propagation behavior of such a trasnmission technique.
|
||||
First, the role of in-line chromatic dispersion compensation has been investigated, deducing that besides being
|
||||
not essential, it is indeed detrimental for performances :cite:`curri_dispersion_2008`.
|
||||
Then, it has been observed that the fiber propagation impairments are practically summarized by the sole NLI, being all the other
|
||||
phenomena compensated for by the blind equalizer implemented in the receiver DSP :cite:`carena_statistical_2010`.
|
||||
Once these assessments have been accepted by the community, several prestigious research groups have started to work
|
||||
on deriving analytical models able to estimating the NLI accumulation, and consequentially the generalized SNR that sets the BER,
|
||||
according to the transponder BER vs. SNR performance.
|
||||
Many models delivering different levels of accuracy have been developed and validated. As previously clarified, for the purposes
|
||||
of the PSE framework, the GN-model with incoherent accumulation of NLI over fiber spans has been selected as adequate.
|
||||
The reason for such a choice is first such a model being a "local" model, so related to each fiber spans, independently of
|
||||
the preceding and succeeding network elements. The other model characteristic driving the choice is
|
||||
the availability of a closed form for the model, so permitting a real-time evaluation, as required by the PSE framework.
|
||||
For a detailed derivation of the model, please refer to :cite:`poggiolini_analytical_2011`, while a qualitative description
|
||||
can be summarized as in the following.
|
||||
The GN-model assumes that the channel comb propagating in the fiber is well approximated by unpolarized spectrally shaped
|
||||
Gaussian noise. In such a scenario, supposing to rely - as in state-of-the-art equipment - on a receiver entirely compensating for linear propagation effects, propagation in the fiber only excites the four-wave mixing (FWM) process among the continuity of
|
||||
the tones occupying the bandwidth. Such a FWM generates an unpolarized complex Gaussian disturbance in each spectral slot
|
||||
that can be easily evaluated extending the FWM theory from a set of discrete tones - the standard FWM theory introduced back in the 90s by Inoue :cite:`Innoue-FWM`- to a continuity of tones, possibly spectrally shaped.
|
||||
Signals propagating in the fiber are not equivalent to Gaussian noise, but thanks to the absence of in-line compensation for choromatic dispersion,
|
||||
the become so, over short distances.
|
||||
So, the Gaussian noise model with incoherent accumulation of NLI has estensively proved to be a quick yet accurate and conservative tool
|
||||
to estimate propagation impairments of fiber propagation.
|
||||
Note that the GN-model has not been derived with the aim of an *exact* performance estimation, but to pursue a conservative performance prediction. So, considering these characteristics, and the fact that the NLI is always a secondary effect with respect to the ASE noise accumulation, and - most importantly - that typically linear propagation parameters (losses, gains and noise figures) are known within
|
||||
a variation range, a QoT estimator based on the GN model is adequate to deliver performance predictions in terms of a reasonable SNR range, rather than an exact value.
|
||||
As final remark, it must be clarified that the GN-model is adequate to be used when relying on a relatively narrow bandwidth up to few THz. When exceeding such a bandwidth occupation, the GN-model must be generalized introducing the interaction with the Stimulated
|
||||
Raman Scattering in order to give a proper estimation for all channels :cite:`cantono2018modeling`.
|
||||
This will be the main upgrade required within the PSE framework.
|
||||
|
||||
|
||||
.. bibliography:: biblio.bib
|
||||
@@ -22,14 +22,16 @@ PSE WG Charter
|
||||
- The PSE will influence and benefit from the innovation of the DTC, API, and OLS working groups.
|
||||
- The PSE represents a step along the journey towards multi-layer optimization.
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
* GNPY simulation of an amplified optical link
|
||||
Documentation
|
||||
=============
|
||||
|
||||
The following pages are meant to describe specific implementation details and modeling assumptions behind GNpy.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
gn_model
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
@@ -38,10 +40,31 @@ Indices and tables
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
Contributors
|
||||
============
|
||||
Mattia Cantono, Alessio Ferrari, Vittorio Curri - Politecnico di Torino - Italy
|
||||
Gilad Goldfarb, Brian Taylor - Facebook Inc.
|
||||
James Powell
|
||||
Gert Grammel - Juniper Inc.
|
||||
Contributors in alphabetical order
|
||||
==================================
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
| Name | Surname | Affiliation | Contact |
|
||||
+==========+============+=======================+============================+
|
||||
| Alessio | Ferrari | Politecnico di Torino | alessio.ferrari@polito.it |
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
| Brian | Taylor | Facebook | briantaylor@fb.com |
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
| David | Boertjes | Ciena | dboertje@ciena.com |
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
| Esther | Le Rouzic | Orange | esther.lerouzic@orange.com |
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
| Gabriele | Galimberti | Cisco | ggalimbe@cisco.com |
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
| Gert | Grammel | Juniper Networks | ggrammel@juniper.net |
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
| Gilad | Goldfarb | Facebook | giladg@fb.com |
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
| James | Powell | Consultant | james@dontusethiscode.com |
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
| Jeanluc | Auge | Orange | jeanluc.auge@orange.com |
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
| Mattia | Cantono | Politecnico di Torino | mattia.cantono@polito.it |
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
| Vittorio | Curri | Politecnico di Torino | vittorio.curri@polito.it |
|
||||
+----------+------------+-----------------------+----------------------------+
|
||||
|
||||
|
||||
70
docs/source/gnpy.core.rst
Normal file
70
docs/source/gnpy.core.rst
Normal file
@@ -0,0 +1,70 @@
|
||||
gnpy\.core package
|
||||
==================
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
gnpy\.core\.elements module
|
||||
---------------------------
|
||||
|
||||
.. automodule:: gnpy.core.elements
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.execute module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: gnpy.core.execute
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.info module
|
||||
-----------------------
|
||||
|
||||
.. automodule:: gnpy.core.info
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.network module
|
||||
--------------------------
|
||||
|
||||
.. automodule:: gnpy.core.network
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.node module
|
||||
-----------------------
|
||||
|
||||
.. automodule:: gnpy.core.node
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.units module
|
||||
------------------------
|
||||
|
||||
.. automodule:: gnpy.core.units
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
gnpy\.core\.utils module
|
||||
------------------------
|
||||
|
||||
.. automodule:: gnpy.core.utils
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: gnpy.core
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
17
docs/source/gnpy.rst
Normal file
17
docs/source/gnpy.rst
Normal file
@@ -0,0 +1,17 @@
|
||||
gnpy package
|
||||
============
|
||||
|
||||
Subpackages
|
||||
-----------
|
||||
|
||||
.. toctree::
|
||||
|
||||
gnpy.core
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: gnpy
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
7
docs/source/modules.rst
Normal file
7
docs/source/modules.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
gnpy
|
||||
====
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
|
||||
gnpy
|
||||
@@ -14,7 +14,9 @@
|
||||
"params": {
|
||||
"length": 80,
|
||||
"loss_coef": 0.2,
|
||||
"length_units": "km"
|
||||
"length_units": "km",
|
||||
"dispersion": 16.7E-6,
|
||||
"gamma": 1.27E-3
|
||||
},
|
||||
"metadata": {
|
||||
"latitude": 1,
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
"""
|
||||
Network elements class with SpectralInformation propagation using
|
||||
__call__ and propagate methods
|
||||
@author: Alessio Ferrari
|
||||
@author: Mattia Cantono
|
||||
@author: Vittorio Curri
|
||||
@author: giladgoldfarb
|
||||
@author: briantaylor
|
||||
@author: jeanluc-auge
|
||||
@@ -30,7 +33,7 @@ class Transceiver(Node):
|
||||
osnr_nli = [lin2db(c.power.signal/c.power.nli) for c in spectral_info.carriers]
|
||||
snr = [lin2db(c.power.signal/(c.power.nli+c.power.ase)) for c in spectral_info.carriers]
|
||||
print('OSNR in signal bandwidth={}dB and in 0.1nm={}dB'.format(osnr_ase[0], osnr_ase_01nm[0]))
|
||||
return snr
|
||||
return snr
|
||||
|
||||
def __call__(self, spectral_info):
|
||||
return spectral_info
|
||||
@@ -39,9 +42,11 @@ class Fiber(Node):
|
||||
def __init__(self, config):
|
||||
super().__init__(config)
|
||||
self.length = self.params.length * \
|
||||
UNITS[self.params.length_units] #length in km
|
||||
self.loss_coef = self.params.loss_coef #lineic loss dB/km
|
||||
self.lin_loss_coef = self.params.loss_coef / 4.3429448190325184
|
||||
UNITS[self.params.length_units] #length in m
|
||||
self.loss_coef = self.params.loss_coef*1e-3 #lineic loss dB/m
|
||||
self.lin_loss_coef = self.params.loss_coef / (20*np.log10(np.exp(1)))
|
||||
self.dispersion = self.params.dispersion #s/m/m
|
||||
self.gamma = self.params.gamma #1/W/m
|
||||
#TODO discuss factor 2 in the linear lineic attenuation
|
||||
|
||||
def __repr__(self):
|
||||
@@ -51,48 +56,87 @@ class Fiber(Node):
|
||||
attenuation = self.length * self.loss_coef
|
||||
return db2lin(attenuation)
|
||||
|
||||
def effective_length(self, loss_coef):
|
||||
alpha_dict = self.dbkm_2_lin(loss_coef)
|
||||
@property
|
||||
def effective_length(self):
|
||||
alpha_dict = self.dbkm_2_lin()
|
||||
alpha = alpha_dict['alpha_acoef']
|
||||
leff = 1 - np.exp(-2 * alpha * self.span_length)
|
||||
leff = (1 - np.exp(-2 * alpha * self.length)) / (2*alpha)
|
||||
return leff
|
||||
|
||||
def asymptotic_length(self, loss_coef):
|
||||
alpha_dict = self.dbkm_2_lin(loss_coef)
|
||||
@property
|
||||
def asymptotic_length(self):
|
||||
alpha_dict = self.dbkm_2_lin()
|
||||
alpha = alpha_dict['alpha_acoef']
|
||||
aleff = 1 / (2 * alpha)
|
||||
return aleff
|
||||
|
||||
def dbkm_2_lin(self, loss_coef):
|
||||
def beta2(self, ref_wavelength=None):
|
||||
""" Returns beta2 from dispersion parameter.
|
||||
Dispersion is entered in ps/nm/km.
|
||||
Disperion can be a numpy array or a single value. If a
|
||||
value ref_wavelength is not entered 1550e-9m will be assumed.
|
||||
ref_wavelength can be a numpy array.
|
||||
"""
|
||||
#TODO: discuss beta2 as method or attribute
|
||||
wl = 1550e-9 if ref_wavelength is None else ref_wavelength
|
||||
D = np.abs(self.dispersion)
|
||||
b2 = (wl**2) * D / (2 * np.pi * c) # 10^21 scales [ps^2/km]
|
||||
return b2 # s/Hz/m
|
||||
|
||||
def dbkm_2_lin(self):
|
||||
""" calculates the linear loss coefficient
|
||||
"""
|
||||
alpha_pcoef = loss_coef
|
||||
alpha_acoef = alpha_pcoef / (2 * 4.3429448190325184)
|
||||
alpha_pcoef = self.loss_coef
|
||||
alpha_acoef = alpha_pcoef / (2 * 10*np.log10(np.exp(1)))
|
||||
s = 'alpha_pcoef is linear loss coefficient in [dB/km^-1] units'
|
||||
s = ''.join([s, "alpha_acoef is linear loss field amplitude \
|
||||
coefficient in [km^-1] units"])
|
||||
coefficient in [m^-1] units"])
|
||||
d = {'alpha_pcoef': alpha_pcoef,
|
||||
'alpha_acoef': alpha_acoef,
|
||||
'description:': s}
|
||||
return d
|
||||
|
||||
def beta2(self, dispersion, ref_wavelength=None):
|
||||
""" Returns beta2 from dispersion parameter. Dispersion is entered in
|
||||
ps/nm/km. Disperion can be a numpy array or a single value. If a
|
||||
value ref_wavelength is not entered 1550e-9m will be assumed.
|
||||
ref_wavelength can be a numpy array.
|
||||
|
||||
def _psi(self, carrier, interfering_carrier):
|
||||
""" Calculates eq. 123 from arXiv:1209.0394.
|
||||
"""
|
||||
wl = 1550e-9 if ref_wavelength is None else ref_wavelength
|
||||
D = np.abs(dispersion)
|
||||
b2 = (10**21) * (wl**2) * D / (2 * np.pi * c) # 10^21 scales [ps^2/km]
|
||||
return b2
|
||||
if carrier.num_chan == interfering_carrier.num_chan: # SCI
|
||||
psi = np.arcsinh(0.5 * np.pi**2 * self.asymptotic_length
|
||||
* abs(self.beta2()) * carrier.baud_rate**2)
|
||||
else: # XCI
|
||||
delta_f = carrier.freq - interfering_carrier.freq
|
||||
psi = np.arcsinh(np.pi**2 * self.asymptotic_length * abs(self.beta2()) *
|
||||
carrier.baud_rate * (delta_f + 0.5 * interfering_carrier.baud_rate))
|
||||
psi -= np.arcsinh(np.pi**2 * self.asymptotic_length * abs(self.beta2()) *
|
||||
carrier.baud_rate * (delta_f - 0.5 * interfering_carrier.baud_rate))
|
||||
|
||||
return psi
|
||||
|
||||
def _gn_analytic(self, carrier, *carriers):
|
||||
""" Computes the nonlinear interference power on a single carrier.
|
||||
The method uses eq. 120 from arXiv:1209.0394.
|
||||
:param carrier: the signal under analysis
|
||||
:param carriers: the full WDM comb
|
||||
:return: carrier_nli: the amount of nonlinear interference in W on the under analysis
|
||||
"""
|
||||
|
||||
g_nli = 0
|
||||
for interfering_carrier in carriers:
|
||||
psi = self._psi(carrier, interfering_carrier)
|
||||
g_nli += (interfering_carrier.power.signal/interfering_carrier.baud_rate)**2 *\
|
||||
(carrier.power.signal/carrier.baud_rate) * psi
|
||||
|
||||
g_nli *= (16 / 27) * (self.gamma * self.effective_length)**2 /\
|
||||
(2 * np.pi * abs(self.beta2()) * self.asymptotic_length)
|
||||
|
||||
carrier_nli = carrier.baud_rate*g_nli
|
||||
return carrier_nli
|
||||
|
||||
def propagate(self, *carriers):
|
||||
#TODO integrate and call the gn.ole module to calculate carrier nli noise in fiber
|
||||
carrier_nli = db2lin(-28)*1e-3 #temporary Cte nli noise is added for debug
|
||||
|
||||
i=0
|
||||
for carrier in carriers:
|
||||
pwr = carrier.power
|
||||
carrier_nli = self._gn_analytic(carrier, *carriers)
|
||||
pwr = pwr._replace(signal=pwr.signal/self.lin_attenuation(),
|
||||
nonlinear_interference=(pwr.nli+carrier_nli)/self.lin_attenuation(),
|
||||
amplified_spontaneous_emission=pwr.ase/self.lin_attenuation())
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
UNITS = {'m': 1e-3,
|
||||
'km': 1}
|
||||
UNITS = {'m': 1,
|
||||
'km': 1E3}
|
||||
|
||||
@@ -1,11 +1,36 @@
|
||||
alabaster==0.7.10
|
||||
attrs==17.4.0
|
||||
Babel==2.5.3
|
||||
certifi==2017.11.5
|
||||
chardet==3.0.4
|
||||
cycler==0.10.0
|
||||
decorator==4.1.2
|
||||
docutils==0.14
|
||||
idna==2.6
|
||||
imagesize==0.7.1
|
||||
Jinja2==2.10
|
||||
latexcodec==1.0.5
|
||||
MarkupSafe==1.0
|
||||
matplotlib==2.1.0
|
||||
networkx==2.0
|
||||
numpy==1.13.3
|
||||
scipy==1.0.0
|
||||
oset==0.1.3
|
||||
pluggy==0.6.0
|
||||
py==1.5.2
|
||||
pybtex==0.21
|
||||
pybtex-docutils==0.2.1
|
||||
Pygments==2.2.0
|
||||
pyparsing==2.2.0
|
||||
pytest==3.3.2
|
||||
python-dateutil==2.6.1
|
||||
pytz==2017.3
|
||||
PyYAML==3.12
|
||||
requests==2.18.4
|
||||
scipy==1.0.0
|
||||
six==1.11.0
|
||||
snowballstemmer==1.2.1
|
||||
Sphinx==1.6.6
|
||||
sphinxcontrib-bibtex==0.3.6
|
||||
sphinxcontrib-websupport==1.0.1
|
||||
urllib3==1.22
|
||||
xlrd==1.1.0
|
||||
|
||||
3
tests/__init__.py
Normal file
3
tests/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from .test_utilities import *
|
||||
16
tests/test_utilities.py
Normal file
16
tests/test_utilities.py
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import pytest
|
||||
from gnpy.core.utils import db2lin
|
||||
def test_db2lin():
|
||||
assert pytest.approx(10.0)==db2lin(10.0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from logging import getLogger, basicConfig, INFO
|
||||
logger = getLogger(__name__)
|
||||
basicConfig(level=INFO)
|
||||
|
||||
logger.info(f'Running {test}')
|
||||
test_db2lin()
|
||||
|
||||
Reference in New Issue
Block a user