Original filter has permanent offset of result because of bad handling of fixed point arithmetic. The offset is about 100ns so it is not much while using SW timestamping but it is huge, while using HW timestamping.
Filter works same as the previous one in exception that it works better with small variations of path Delay.
Same changes can be applied to v1.
Filter is also easily to understand than the previous one. It is Exponential smoothing.
alpha = 1/2^s
y[n] = alpha * x[n-1] + (1-alpha) * y[n-1]
I have done lot of numeric simulations in SciLab to prove, that the filter is correct.
Now it is easy to do only one filter function which is used 3 times.