title: Scipy: Find Shift between Two Signals of Different Length
body: <p>In python, I have two similar signals of different lengths, and I want to find the offset between them. </p>
  
  <p>I found this post: <a href="https://stackoverflow.com/questions/4688715/find-time-shift-between-two-similar-waveforms">find time shift between two similar waveforms</a></p>
  
  <p>But I don't understand the interpretation for different length signals.</p>
  
  <p>For example:</p>
  
  <pre><code>a=[0,0,1,2,3]
  b=[0,0,0,0,1,2,3,0]
  </code></pre>
  
  <p>and <code>numpy.argmax(scipy.signal.correlate(a,b))</code> gives <code>5</code>, which I don't understand. <code>numpy.argmax(scipy.signal.correlate(b,a))</code> gives <code>6</code>, which seems like the amount that <code>b</code> should be shifted to the right, assuming wrap-around. Can someone please explain?</p>