Displaying 1 result from an estimated 1 matches for "acorr".
Did you mean:
xcorr
2013 Jan 07
0
Something wrong with echo_diagnostic.m
...ile, 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)];
N = length(rec);
corr = real(ifft(fft(rec).*conj(fft(play))));
acorr = real(ifft(fft(play).*conj(fft(play))));
[a,b] = max(corr);
if b > N/2
b = b-N;
end
printf ("Far end to near end delay is %d samples\n", b);
if (b > .3*tail_length)
printf ('This is too much delay, try delaying the far-end signal
a bit\n');
else if (b < 0...