title: Find phase difference between two (inharmonic) waves
body: <p>I have two datasets listing the average voltage outputs of two assemblies of neural networks at times t, that look something like this:</p>
  
  <pre><code>A = [-80.0, -80.0, -80.0, -80.0, -80.0, -80.0, -79.58, -79.55, -79.08, -78.95, -78.77, -78.45,-77.75, -77.18, -77.08, -77.18, -77.16, -76.6, -76.34, -76.35]
  
  B = [-80.0, -80.0, -80.0, -80.0, -80.0, -80.0, -78.74, -78.65, -78.08, -77.75, -77.31, -76.55, -75.55, -75.18, -75.34, -75.32, -75.43, -74.94, -74.7, -74.68]
  </code></pre>
  
  <p>When two neural assemblies are "in phase" to a reasonable extent, that means that they are interrelated. What I want to do is calculate the phase difference between A and B, preferably over the whole time of the simulation. Since two assemblies are unlikely to be totally in phase, I want to compare that phase difference to a certain threshold.</p>
  
  <p>These are inharmonic oscillators and I don't know their functions, only these values, so I have no idea how to determine the phase or the respective phase difference.</p>
  
  <p>I am doing this project in Python, using numpy and scipy (the two assemblies are numpy arrays).</p>
  
  <p>Any suggestions would be greatly appreciated!</p>
  
  <p><strong>EDIT: Added plots</strong></p>
  
  <p><a href="http://server1.brainstormit.nl/vb-sync-XReport.txt" rel="noreferrer">Example datafile for assembly 1</a></p>
  
  <p><a href="http://server1.brainstormit.nl/vb-sync-YReport.txt" rel="noreferrer">Example datafile for assembly 2</a></p>
  
  <p>Here is a plot of what the two datasets look like:
  <img src="https://i.stack.imgur.com/l3fbP.png" alt="Plot of two neural assemblies overlapping">
  <img src="https://i.stack.imgur.com/mrjIh.png" alt="Plot of two neural assemblies seperate"></p>