title: Best way to compare two signals in Matlab
body: <p>I have a signal I made in matlab that I want to compare to another signal (call them y and z).  What I am looking for is a way to assign a value or percentage of how similar two signals are.  </p>
  
  <p>I was trying to use corrcoef, but I get very poor values (<code>corrcoef(y,z) = -0.1141</code>), yet when I look at the FFT of the two plots superimposed on each other, I would have visually said that they are <strong>very</strong> similar.  Taking a look at the corrcoef of the FFT of the magnitude of the two signals looks a lot more promising: <code>corrcoef(abs(fft(y)),abs(fft(z))) = 0.9955</code>, but I am not sure if that is the best way to go about it since the two signals in their pure form appear to not be correlated.</p>
  
  <p>Does anyone have a recommendation of how to compare two signals in Matlab as described?</p>
  
  <p>Thanks!</p>