Commit afac19eb authored by Jose Lopez's avatar Jose Lopez Committed by Adam Wujek

wr_mon: Added corrected estimation of link length

Previous versions (4.0-4.1) incurred several errors when estimating the fiber length.

By definition, the speed v at which light travels through a medium with refractive index n is v=c/n
Since for the ITU-T G.652 D recommendation:

	"the refractive index profile of the fibre does not generally need to be known"

we chose a value provided by one of the most popular G.652 fiber manufacturers
for 1550 nm in their product information as seen in:
https://www.corning.com/media/worldwide/coc/documents/Fiber/SMF-28%20Ultra.pdf
parent aefda36f
...@@ -587,6 +587,18 @@ void show_servo(int alive) ...@@ -587,6 +587,18 @@ void show_servo(int alive)
term_cprintf(C_WHITE, "%15.3f nsec\n", term_cprintf(C_WHITE, "%15.3f nsec\n",
ppsi_servo_local.picos_mu/1000.0); ppsi_servo_local.picos_mu/1000.0);
term_cprintf(C_BLUE, "Estimated link length: ");
/* (RTT - deltas) / 2 * c / ri
c = 299792458 - speed of light in m/s
ri = 1.4682 - refractive index for fiber g.652 */
term_cprintf(C_WHITE, "%10.2f meters\n",
(ppsi_servo_local.picos_mu
- ppsi_servo_local.delta_tx_m
- ppsi_servo_local.delta_rx_m
- ppsi_servo_local.delta_tx_s
- ppsi_servo_local.delta_tx_s
) / 2 / 1e6 * 299.792458 / 1.4682);
term_cprintf(C_BLUE, "Master-slave delay: "); term_cprintf(C_BLUE, "Master-slave delay: ");
term_cprintf(C_WHITE, "%15.3f nsec\n", term_cprintf(C_WHITE, "%15.3f nsec\n",
ppsi_servo_local.delta_ms/1000.0); ppsi_servo_local.delta_ms/1000.0);
...@@ -594,6 +606,7 @@ void show_servo(int alive) ...@@ -594,6 +606,7 @@ void show_servo(int alive)
term_cprintf(C_BLUE, "Total link asymmetry: "); term_cprintf(C_BLUE, "Total link asymmetry: ");
term_cprintf(C_WHITE, "%15.3f nsec, ", term_cprintf(C_WHITE, "%15.3f nsec, ",
total_asymmetry / 1000.0); total_asymmetry / 1000.0);
/* print alpha as fixed point number */
term_cprintf(C_BLUE, "alpha: "); term_cprintf(C_BLUE, "alpha: ");
term_cprintf(C_WHITE, "%d\n", term_cprintf(C_WHITE, "%d\n",
ppsi_servo_local.fiber_fix_alpha); ppsi_servo_local.fiber_fix_alpha);
......
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