Handel zero correlation if at the same time distortion is also zero.

This is the conversation I had with Henrik Lundin regarding this problem.

Me:
In Expand::AnalyseSignal() we compute correlation and distortion, then calculate the ratio of correlation to distortion. There if distortion is zero we expect that correlation to be zero. Although in practice this might be true, I suppose we rarely hit into absolutely periodic signal, but in one of the tests the assertion in line 455 of expand.cc was triggered. The distortion is computed over a shorter length of the signal, while correlation is computed over longer segments. Therefore, I guess, if the signal has just enough zeros at the beginning we can end up in situation that distortion is zero but not the correlation. Do you agree? I didn't have time to attempt to solve this, but if my line of thought is correct, we should not have that assert. Perhaps, if correlation is zero we set the ratio to 0, otherwise, ratio would be the largest value of its own type. Any thoughts?

Henrik:
I agree with you. Go ahead with your solution.

R=minyue@google.com

Review URL: https://webrtc-codereview.appspot.com/1888006

git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@4448 4adac7df-926f-26a2-2b94-8c16560cd09d
1 file changed