title: Grouping of measurements by interval between them
body: <p>For a project I'm taking measurements of air pressure at a very high interval (1-5ms). If the pressure has changed within a margin of error I add that data to my list. An example would look like this:</p>
  <pre><code>timestamp (ms)   pressure (%)
  311                 10
  714                 16
  844                  4
  941                 31
  977                 55
  1080                65
  1211                27
  </code></pre>
  <p>This data is taken and displayed live, which works perfectly with OxyPlot for WPF.
  Data is kept in memory - so no need to access a database, file or something else.</p>
  <p>In addition to the live data I want to display it in a very specific grouping but I don't know what it is called (clustering I think) nor how to do it.</p>
  <p>But let me explain - I want to organize the data to later plot a graph where:</p>
  <ul>
  <li>X = time difference to previous entry (in Hz but that is a simple 1000/x)</li>
  <li>Y = pressure %</li>
  </ul>
  <p>Edit to clarify: For each time difference (X) there should be a column for each pressure value that occured after the given interval.</p>
  <p>This is what the result should look like:
  <a href="https://i.stack.imgur.com/zfFD9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zfFD9.png" alt="This is what it should look like" /></a></p>
  <p>This graph should only consist of the last x entries of my complete list (e.g. 1000) and be updated every second or so. I know how to do this the brute force way by looping trough everything and creating nested Arrays. But that certainly can't be the optimal way to do it. So how do I group my dataset to achieve this?</p>
  <p>Any help highly appreciated!</p>