title: resample algorithm for linear array (json)
body: <p>I have an array with 300 elements. This is bars of waveform. 300 bars equal 300px.</p>
  
  <pre><code>[28,26,22,20,28,22,20,24,24,25,23,28,20,29,29,31,31,25,23,18,22,26,27,28,23,26,19,22,24,27,24,27,25,25,22,34,34,31,32,37,37,33,34,35,29,33,32,30,32,34,39,34,32,32,32,33,34,37,38,36,36,36,35,36,32,36,34,36,35,35,33,36,34,34,37,35,33,34,33,31,35,35,33,34,36,36,34,33,35,33,35,36,35,34,30,30,31,34,37,35,36,33,25,31,34,30,25,40,33,25,31,30,26,41,34,28,33,30,24,20,28,27,18,32,27,30,39,35,31,33,29,32,31,31,34,31,42,34,28,35,35,38,38,33,27,38,38,37,43,32,38,38,35,36,41,34,30,21,21,22,21,21,21,21,21,21,21,21,20,21,21,20,21,21,21,22,22,20,21,21,21,21,21,21,21,29,37,39,39,30,38,29,29,35,40,33,41,41,33,36,35,28,30,36,32,32,31,35,30,32,29,29,30,31,32,33,34,33,32,29,30,31,29,27,28,29,28,28,30,28,28,22,28,29,25,24,25,30,32,30,30,28,28,25,28,27,24,23,25,32,30,32,28,26,28,30,28,30,28,29,26,29,29,26,32,29,26,26,30,27,27,24,27,28,33,38,35,24,35,27,21,23,23,28,20,23,28,21,24,18,22,22,23,22,19,27,16,18,37,59,59]
  </code></pre>
  
  <p>I want reduce evenly 50,100,250 elements and get ~250px ~100px ~50px </p>
  
  <p>I am looking resampling algorithm for array like Nearest neighbour but I don't know how apply it on linear array</p>
  
  <p>Example: <a href="http://codepen.io/Alexufo/pen/MyKpXO" rel="nofollow">http://codepen.io/Alexufo/pen/MyKpXO</a></p>