Re: [Linuxptp-devel] [PATCH RFC] Replace moving average with moving median for delay filtering.
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Richard C. <ric...@gm...> - 2013-10-09 19:48:28
|
On Wed, Oct 09, 2013 at 12:19:06PM +0200, Miroslav Lichvar wrote: > The moving average used in the path delay calculation is very sensitive > to outliers. Replace it with moving median. I like this idea. > This, for instance, allows much faster recovery from an external clock > time step which happened between receiving sync message and sending > delay_req message. The measured delay includes a large error, but the > median is still a good estimate of the delay and the first step > correction applied by the servo is right. I wonder what the effect might be in the case running PTP over normal (non-transparent) networks. These introduce a variable path delay, with outliers that keep repeating at some rate. Letting the longer paths into the estimate (in proportion to their occurrence, ie in the average) might perform better in this case than possibly filtering them out. Just thinking out loud... > -tmv_t mave_accumulate(struct mave *m, tmv_t val); > +tmv_t mmedian_accumulate(struct mmedian *m, tmv_t val); "Accumulate" seems like the wrong word for this, but other than that, the patch looks okay to me. Maybe we should offer both options in the manner of the servo interface? Thanks, Richard |