Menu

Filters

2015-09-30
2015-09-30
  • Niels Hornung

    Niels Hornung - 2015-09-30

    Hello,
    in the clokcservo are two LP filters one iir and one fir. Is it correct that a iir is used because the slave to master delay doesnt occure so often and therefore a slower but more accurate iir filter is used. On the opposite the fir filter is used in high timing dependent applications because teh offset from master is calculated every cycle?

    My other questen is: Where does the mean, minimal and amximal filter applies? I think after the lp iir and the lp fir? Or do they replace the lp filters?

     
  • Wojciech Owczarek

    Hi,

    Essentially you are correct, although the filtering deserves a refresh in the code base. Also, the S-M delay does not necessarily have to happen less often, even though some implementations do it that way. I the Telecom profile for example, sync and delay rates are both 16/sec by default.

    Now, the two stat filters are pre-filters, they are only used for packet selection. Well, not mean maybe, but min/max/median are. When configured for "interval" operation, they only pass 1 every n samples. Min and median work best, the rest are more for research purposes really.

    There is actually another filter in the chain, which is the outlier filter.

    The order is:

    1. Pre-filter (separate for delayMS and delaySM):
      Stat filter (optional) -> Outlier filter (optional)
    2. Compute Mean Path Delay and apply IIR
    3. Compute Offset From Master and apply FIR / two-sample moving average.

    The filter chain is quite heavy and can introduce long delays, but PTPd was developed initially with software timestamping in mind, so battling packet delay variation is key.

    Hope this helps,

    Regards,
    Wojciech

     
    • Niels Hornung

      Niels Hornung - 2015-09-30

      Thanks it helps a lot. What about implementing a Kalman Filter. Just an idea i had.

       
  • Wojciech Owczarek

    Kalman can do wonders. I made a few attempts but nothing made it to PTPd codebase.

     

Log in to post a comment.