Refactor common CatalogUtils step 2
Improve getPceRoadmAmpParameters method implementation
- remove useless intermediate variables
- fix Interchannel spacing correction factor in OSNR calculation
ADD case formula (forgotten 10 factor).
- introduce a list for OSNR computation polynomial factors and review
order of arithmetic operations with a for-loop for more precision
and efficiency.
Double is not strictly spoken a Mathematics commutative group because
computers design limits their bits representation size.
As a result, the order of arithmetic operation matters.
In a sum, smallest numbers should be introduced first for a maximum of
precision. In other words, the sum
10 * Math.log10(spacing / 50.0)
+ osnrPolynomialFits.get(0)
+ osnrPolynomialFits.get(1) * pwrIn
+ osnrPolynomialFits.get(2) * Math.pow(pwrIn, 2)
+ osnrPolynomialFits.get(3) * Math.pow(pwrIn, 3)
is not equal to its reverse form
osnrPolynomialFits.get(3) * Math.pow(pwrIn, 3)
+ osnrPolynomialFits.get(2) * Math.pow(pwrIn, 2)
+ osnrPolynomialFits.get(1) * pwrIn
+ osnrPolynomialFits.get(0)
+ 10 * Math.log10(spacing / 50.0)
and the more precise first form should be preferred here.
- Adapt comments and Junit tests accordingly
JIRA: TRNSPRTPCE-518
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I7dcf500eb7ff93aacfe594dbe2d6e6125dab2e03