Xcorr - plot correlation across time.

조회 수: 9 (최근 30일)
Callum Blanchfield
Callum Blanchfield 2012년 5월 5일
Hi,
I'm very new to Matlab and what i'm trying to do is find the correlation of two separate audio .wav files. At the moment I have the following (x & y are my .wavs):
C = xcorr(x,y,'coeff');
ICC = max(abs(C));
This allows me to find the point with the highest correlation, right?
But what I want to do is take a reading of the xcorr or 'C' at 80ms intervals so I can plot the correlation over time, rather than just at one point.
Any ideas?
Thanks in advance.
  댓글 수: 1
RNTL
RNTL 2012년 6월 10일
but you do have it over time, that's what C means.
and (if both signals have the same sample rate) it is spaced according to the sampling time.

댓글을 달려면 로그인하십시오.

채택된 답변

Wayne King
Wayne King 2012년 6월 10일
t = 0:0.001:1-0.001;
x = cos(2*pi*100*t)+randn(size(t));
y = sin(2*pi*100*t)+randn(size(t));
[xc,lags] = xcorr(x,y,'coeff');
stem(lags*0.001,xc);
The above gives the lags as sampling intervals, 0.001 seconds in this example.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by