Detect Clock Jitter from Timestamps

Medium Python Timing Asked at Cadence
Solve this problem

Given a list of edge timestamps from a logic analyser, compute period jitter statistics: mean period, peak-to-peak jitter and RMS jitter.

Constraints

  • Input is a sorted list of timestamps in nanoseconds.
  • Fewer than 3 timestamps must raise ValueError.
  • Return a dict with mean_period, pp_jitter and rms_jitter.
  • RMS jitter is the standard deviation of the periods.
  • No pandas.
Starter codePython
1def jitter_stats(timestamps):2    # TODO3    return {}