[xiph-commits] r12804 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Sat Mar 24 23:50:56 PDT 2007
Author: jm
Date: 2007-03-24 23:50:54 -0700 (Sat, 24 Mar 2007)
New Revision: 12804
Modified:
trunk/speex/libspeex/echo_diagnostic.m
Log:
fixed negative offset handling in echo diagnostic
Modified: trunk/speex/libspeex/echo_diagnostic.m
===================================================================
--- trunk/speex/libspeex/echo_diagnostic.m 2007-03-23 11:49:35 UTC (rev 12803)
+++ trunk/speex/libspeex/echo_diagnostic.m 2007-03-25 06:50:54 UTC (rev 12804)
@@ -41,12 +41,12 @@
corr2 = real(ifft(fft(rec(N2+1:end)).*conj(fft(play(N2+1:end)))));
[a,b1] = max(corr1);
-if b1 > N/2
- b1 = b1-N;
+if b1 > N2/2
+ b1 = b1-N2;
end
[a,b2] = max(corr2);
-if b2 > N/2
- b2 = b2-N;
+if b2 > N2/2
+ b2 = b2-N2;
end
drift = (b1-b2)/N2;
printf ('Drift estimate is %f%% (%d samples)\n', 100*drift, b1-b2);
More information about the commits
mailing list