title: Linear resampling datapoints captured at fluctuating time intervals, to flxed time intervals, in swift
body: <p>I want to linearly interpolate some metrics that are captured at times that fluctuate, to fixed timing intervals.</p>
  
  <pre><code>let original_times:[Double] = [0.0,1.3,2.2,3.4,4.2,5.5,6.6,7.2,8.4,9.5,10.0]
  let metric_1:[Double] = [4,3,6,7,4,5,7,4,2,7,2]
  
  let wanted_times:[Double] = [0,1,2,3,4,5,6,7,8,9,10]
  
  //linearly resample metric_1 (with corresponding sampling times 'original_times') to fixed time interval times 'wanted_times'
  </code></pre>
  
  <p><code>Accelerate</code> offers <a href="https://developer.apple.com/library/prerelease/ios/documentation/Accelerate/Reference/vDSPRef/index.html#//apple_ref/doc/uid/TP40009464-CH13-SW19" rel="nofollow">vDSP_vlint</a> but I'm struggling to figure out how to implement it for my application.</p>
  
  <pre><code>func vDSP_vlint(_ __A: UnsafePointer&lt;Float&gt;, _ __B: UnsafePointer&lt;Float&gt;, _ __IB: vDSP_Stride, _ __C: UnsafeMutablePointer&lt;Float&gt;, _ __IC: vDSP_Stride, _ __N: vDSP_Length, _ __M: vDSP_Length)
  </code></pre>