Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Which Matlab function is for cross-correlating two signals?

Status
Not open for further replies.

scholar_a

Member level 1
Joined
Jul 4, 2007
Messages
35
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Iran
Activity points
1,522
in order to crosscrrolate two signals which of these two Matlab uctions are true? "xcorr" or "crosscorr"
 

xcorr crosscorr

xcorr is only what I am aware of. There is no crosscorr in my version.
 

    scholar_a

    Points: 2
    Helpful Answer Positive Rating
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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top