title: Resampling a signal with scipy.signal.resample
body: <p>I was trying to resample a generated signal from <code>256</code> samples to <code>20</code> samples using this code:</p>
  <pre><code>import scipy.signal 
  import matplotlib.pyplot as plt
  import numpy as np
  
  x = np.linspace(0, 10, 256, endpoint=False)
  y = np.cos(-x**2/6.0)
  yre = signal.resample(y,20)
  xre = np.linspace(0, 10, len(yre), endpoint=False)
  plt.plot(x,y,'b', xre,yre,'or-')
  plt.show()
  </code></pre>
  <p>Which returns this plot (apparently correct):
  <a href="https://i.stack.imgur.com/gInsU.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gInsU.png" alt="enter image description here" /></a></p>
  <p>However, as can be noticed, the first sample is badly approximated. I believe that <code>resample</code> computes the average of the samples that belongs to equidistant groups of samples and, in this case, it seems that the first subgroup of samples is padded with zeros in the beggining in order to estimate the first output sample.</p>
  <p>Thus, I consider that the first sample can be successfully estimated by telling <code>resample</code> function that I do not want to pad with zeroes the first subgroup.</p>
  <p>Can somebody help me in order to achieve a correct resampling of this signal?</p>
  <p>Thanks in advance.</p>