The timing recovery logic was changed to an early / late detector a few
years ago in order to make it less sensitive to null crossings, which
are easily thrown off by the fact that mark and space have their own
low pass filters, and the discriminator calculating the envelope for each
separately.
The discriminator output can have mark deviate further from zero than
space, or the other way around, which can shift the null crossings
around in unpredictable ways.
Finding the actual peaks in the discriminator output itself appears
to be a little more predictable. It allows us to get rid of the
accumulator logic, and expand the loop bandwidth so we can now
track the example NAVTEX signal from https://www.sigidwiki.com/wiki/NAVTEX,
which runs about .25% fast, which can be seen from a consistent adjustment
of around -2 samples every 8 bit periods.
The resulting code can still decode signals from the USGS (Honolulu),
Canada (Moise and Chebogue), and Buenos Aires, all of which are much
lower S/N but closer to the nominal baud rate than the example signal.
navtex: fix and simplify timing recovery logic
The timing recovery logic was changed to an early / late detector a few years ago in order to make it less sensitive to null crossings, which are easily thrown off by the fact that mark and space have their own low pass filters, and the discriminator calculating the envelope for each separately.
The discriminator output can have mark deviate further from zero than space, or the other way around, which can shift the null crossings around in unpredictable ways.
Finding the actual peaks in the discriminator output itself appears to be a little more predictable. It allows us to get rid of the accumulator logic, and expand the loop bandwidth so we can now track the example NAVTEX signal from https://www.sigidwiki.com/wiki/NAVTEX, which runs about .25% fast, which can be seen from a consistent adjustment of around -2 samples every 8 bit periods.
The resulting code can still decode signals from the USGS (Honolulu), Canada (Moise and Chebogue), and Buenos Aires, all of which are much lower S/N but closer to the nominal baud rate than the example signal.
Signed-off-by: Rik van Riel riel@surriel.com