Cross Correlation to determine Delay

조회 수: 3 (최근 30일)
Samuel
Samuel 2023년 6월 2일
댓글: Tim 2023년 6월 2일
Hi,
I have 2 signals of equal length. The signals correlate but with a time delay. I thought of doing a cross-correlation between both signals to determine the lag at which both signals have the maximum correlation. I've written the following line of code to do that.
[c,lags]=xcorr(signal1,signal2,20);
Plotting both signals and their cross-correlation returns this.
I was expecting to see a peak at approx. positive or negative 10 because that's when both signals drop significantly. I can't seem to figure out why that isn't the case. Is it because both signals have the same length?
Any help would be very much appreciated!
  댓글 수: 3
Samuel
Samuel 2023년 6월 2일
Can I achieve that by subtracting the mean from my signals?
Tim
Tim 2023년 6월 2일
yes

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

답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by