crosscorr matlab
brmadhukar thank you for your helpful guide. I have another problem too:
there is a linear microphone array like this: x1 x2 x3 x4 x5 x6 x7 x8
The speech signal has propogated 1m from the center of the array.
I have written this code in order to find the sample delays that each microphone recieves the speech signal.
first using "wavread" function the signals are read
mic1=wavread('s1');
mic2=wavread('s2');
mic3=wavread('s3');
mic4=wavread('s4');
mic5=wavread('s5');
mic6=wavread('s6');
mic7=wavread('s7');
mic8=wavread('s8');
Now crosscorellate the input signals with reference signal (mic4) and find the sample in which the maximum occures. The sample in which miximum occures is the sample delay
%%%%%%%Synchronyze all input signals%%%%%%%
% cross-correlate the input signals
C1=xcorr(mic4,mic1); % mic4 is reference signal and has no delays
C2=xcorr(mic4,mic2);
C3=xcorr(mic4,mic3);
C4=xcorr(mic4,mic4);
C5=xcorr(mic4,mic5);
C6=xcorr(mic4,mic6);
C7=xcorr(mic4,mic7);
C8=xcorr(mic4,mic8);
% find the sample in which cross-corelation reaches it's maximun
b=1;
for k=2:41
if C8(k,1) >= C8(b,1)
b=k;
else
b=b;
end
end
return
I run this code and for all C1,C2,...,C8 sample delay is equal to "1".
I don't know what is my mistake?!!!
LOOKING FORWARD TO HEAR FROM YOU ALL.
REGARDS