Skip to content

Looking to optimize precision of 'frame.off_start' #59

@mungewell

Description

@mungewell

I have been working with the sister project LTC-tools to feed an externally generated LTC signal into NPT/Chrony, with pretty good success.... Here's some 30NDF analysed by Chrony
better3

What is clear in the image is the horizontal banding, with the bands being ~20us apart (this is the 48KHz sample rate). It would seem that perhaps the integer nature of 'frame.off_start' is causing some jitter in the reported timing. Even though the timing is precise enough to record the variance, I am getting a swing of ~10 samples in detected 'off_start'.

I have looked at 'decoder.c' and it's not really clear to me how it 'finds' the start of the frame.

Dumping the biphase info I get:

00-00-00 +0000 03:22:31:13
20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 
20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 
20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 
20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 
20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 
20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 
20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 
20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 
20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 
20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 20.000000, 
:267, 842, 1600.000000

00-00-00 +0000 03:22:31:14
19.999060, 19.999060, 19.999296, 20.499472, 19.874603, 19.874603, 19.905952, 19.905952, 
19.929464, 19.929464, 19.947098, 19.947098, 19.960323, 19.960323, 19.970243, 19.970243, 
19.977682, 20.483261, 19.862446, 19.896835, 19.922626, 19.922626, 19.941969, 19.941969, 
19.956476, 19.956476, 19.967358, 19.967358, 19.975519, 19.975519, 19.981638, 19.981638, 
19.986229, 19.986229, 19.989672, 19.989672, 19.992254, 19.992254, 19.994190, 19.994190, 
19.995644, 19.995644, 19.996733, 19.996733, 19.997549, 19.997549, 19.998161, 19.998161, 
19.998621, 19.998621, 19.998966, 19.998966, 19.999224, 19.999418, 19.999563, 19.999672, 
19.999754, 20.499817, 19.874863, 19.906147, 19.929609, 19.947206, 19.960405, 19.970304, 
19.977728, 20.483295, 19.862473, 19.896854, 19.922640, 19.941980, 19.956486, 20.467363, 
19.850523, 19.887892, 19.915918, 19.936939, 19.952705, 19.952705, 19.964529, 20.473396, 
:843, 392, 1599.809204

The last line is 'off_start', 'off_end' and the sum of the biphase bit timing. Typically I see all '20.0000', some frames show different values.

Does anyone have suggestions on how this might be improved (less variance), or where to look at the code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions