title: Resampling data with minimal loss of information in time-domain
body: <p>I am trying to resample/recreate already recorded data for plotting purposes. I thought this is best place to ask the question (besides dsp.se).</p>
  
  <p>The data is sampled at high frequency, contains to much data points and not suitable for plotting in time domain (not enough memory). i want to sample it with minimal loss. The sampling interval of the resulting data doesn't need to be same (well it is again for plotting purposes, not analysis) although input data in equally sampled.
  When we use the regular resample command from matlab/octave, it can distort <em>stiff</em> pieces of the curve.</p>
  
  <p>What is the best approach here?</p>
  
  <p>For reference I put two pictures found in tex.se)
  First image is regular resample
  Second image is a better resampled data that can well behave around peaks.
  <img src="https://i.stack.imgur.com/xvWmh.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/psgCW.png" alt="enter image description here"></p>