[xiph-commits] r12768 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Fri Mar 16 07:27:28 PDT 2007


Author: jm
Date: 2007-03-16 07:27:26 -0700 (Fri, 16 Mar 2007)
New Revision: 12768

Modified:
   trunk/speex/libspeex/echo_diagnostic.m
Log:
uses files instead of vars.


Modified: trunk/speex/libspeex/echo_diagnostic.m
===================================================================
--- trunk/speex/libspeex/echo_diagnostic.m	2007-03-16 14:18:43 UTC (rev 12767)
+++ trunk/speex/libspeex/echo_diagnostic.m	2007-03-16 14:27:26 UTC (rev 12768)
@@ -1,12 +1,19 @@
 % Attempts to diagnose AEC problems from recorded samples
 %
-% out = echo_diagnostic(rec, play, tail_length)
+% out = echo_diagnostic(rec_file, play_file, out_file, tail_length)
 %
 % Computes the full matrix inversion to cancel echo from the 
-% recording 'rec' using the far end signal 'play' using a filter
-% length of 'tail_length'
-function out = echo_diagnostic(rec, play, tail_length)
+% recording 'rec_file' using the far end signal 'play_file' using 
+% a filter length of 'tail_length'. The output is saved to 'out_file'.
+function out = echo_diagnostic(rec_file, play_file, out_file, tail_length)
 
+F=fopen(rec_file,'rb');
+rec=fread(F,Inf,'short');
+fclose (F);
+F=fopen(play_file,'rb');
+play=fread(F,Inf,'short');
+fclose (F);
+
 rec = [rec; zeros(1024,1)];
 play = [play; zeros(1024,1)];
 
@@ -59,3 +66,7 @@
 h = AtA\bb;
 
 out = (rec - filter(h, 1, play));
+
+F=fopen(out_file,'w');
+fwrite(F,out,'short');
+fclose (F);



More information about the commits mailing list