File spandsp-raise-traintime-tolerance.diff of Package spandsp
(Patch reportedly from the iaxmodem project)
Raise v17 training time tolerance, as found in iaxmodem supplied spandsp.
---
src/v17rx.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: spandsp-4712339d6132c54d8624b7d76dddbb36c67df712/src/v17rx.c
===================================================================
--- spandsp-4712339d6132c54d8624b7d76dddbb36c67df712.orig/src/v17rx.c
+++ spandsp-4712339d6132c54d8624b7d76dddbb36c67df712/src/v17rx.c
@@ -987,19 +987,19 @@ static void process_half_baud(v17_rx_sta
/*endif*/
if (++s->training_count >= V17_TRAINING_SHORT_SEG_2_LEN)
{
- /* TODO: This was increased by a factor of 10 after studying real world failures.
- However, it is not clear why this is an improvement, If something gives
- a huge training error, surely it shouldn't decode too well? */
+ /* We need to be liberally accepting of poor fast-train training errors here.
+ Doing this affords the DTE the opportunity to make some use of whatever
+ valid Phase C data can be decoded. */
#if defined(SPANDSP_USE_FIXED_POINTx)
span_log(&s->logging, SPAN_LOG_FLOW, "Short training error %d\n", s->training_error);
s->carrier_track_i = 100;
s->carrier_track_p = 500000;
- if (s->training_error < (int64_t) (V17_TRAINING_SHORT_SEG_2_LEN - 8)*FP_SCALE(4.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
+ if (s->training_error < (int64_t) (V17_TRAINING_SHORT_SEG_2_LEN - 8)*FP_SCALE(10.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
#else
span_log(&s->logging, SPAN_LOG_FLOW, "Short training error %f\n", s->training_error);
s->carrier_track_i = 100.0f;
s->carrier_track_p = 500000.0f;
- if (s->training_error < (V17_TRAINING_SHORT_SEG_2_LEN - 8)*FP_SCALE(4.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
+ if (s->training_error < (V17_TRAINING_SHORT_SEG_2_LEN - 8)*FP_SCALE(10.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
#endif
{
s->training_count = 0;