FreeBSD/contrib/ntp/ntpd/refclock_leitch.c
/*
 * leitch_process - process a pile of samples from the clock
 *
 * This routine uses a three-stage median filter to calculate offset and
 * dispersion. reduce jitter. The dispersion is calculated as the span
 * of the filter (max - min), unless the quality character (format 2) is
 * non-blank, in which case the dispersion is calculated on the basis of
 * the inherent tolerance of the internal radio oscillator, which is
 * +-2e-5 according to the radio specifications.
 */
process a pile of samples from the clock
This routine uses a three-stage median filter to calculate offset and
dispersion. reduce jitter. The dispersion is calculated as the span
of the filter (max - min), unless the quality character (format 2) is
non-blank, in which case the dispersion is calculated on the basis of
the inherent tolerance of the internal radio oscillator, which is
+-2e-5 according to the radio specifications.
process a pile of samples from the clock This routine uses a three - stage median filter to calculate offset and dispersion . reduce jitter . The dispersion is calculated as the span of the filter ( max - min ) unless the quality character ( format 2 ) is non - blank in which case the dispersion is calculated on the basis of the inherent tolerance of the internal radio oscillator which is + - 2e - 5 according to the radio specifications .
static void
leitch_process(
	struct leitchunit *leitch
	)
{
	l_fp off;
	l_fp tmp_fp;
	off = leitch->reftime1;
	L_SUB(&off,&leitch->codetime1);
	tmp_fp = leitch->reftime2;
	L_SUB(&tmp_fp,&leitch->codetime2);
	if (L_ISGEQ(&off,&tmp_fp))
	    off = tmp_fp;
	tmp_fp = leitch->reftime3;
	L_SUB(&tmp_fp,&leitch->codetime3);
	if (L_ISGEQ(&off,&tmp_fp))
	    off = tmp_fp;
	refclock_receive(leitch->peer);
}
static void leitch_process ( struct leitchunit * leitch ) { l_fp off ; l_fp tmp_fp ; off = leitch -> reftime1 ; L_SUB ( & off , & leitch -> codetime1 ) ; tmp_fp = leitch -> reftime2 ; L_SUB ( & tmp_fp , & leitch -> codetime2 ) ; if ( L_ISGEQ ( & off , & tmp_fp ) ) off = tmp_fp ; tmp_fp = leitch -> reftime3 ; L_SUB ( & tmp_fp , & leitch -> codetime3 ) ; if ( L_ISGEQ ( & off , & tmp_fp ) ) off = tmp_fp ; refclock_receive ( leitch -> peer ) ; }
leitch_process - process a pile of samples from the clock
 This routine uses a three-stage median filter to calculate offset and
 dispersion.
leitch_process - process a pile of samples from the clock This routine uses a three - stage median filter to calculate offset and dispersion .
/*double doffset;*/ /*LFPTOD(&off, doffset);*/