필터 지우기
필터 지우기

Normalizing cross-correlation to [-1,1] for different length signals

조회 수: 5 (최근 30일)
Sepp
Sepp 2017년 12월 13일
Hello
I have the following piece of code for calculating the cross-correlation between to signals. Visually, the signals are correlating very well. The signals are of different length but both have a sampling rate of 100Hz. There is a lag between the signals (called timeDiff below).
[acor,lag] = xcorr(signal1,signal2);
[cor,I] = max(abs(acor));
lagDiff = lag(I);
timeDiff = lagDiff/100;
fprintf('Correlation = %0.5f \n',cor);
I'm getting a correlation of 6239.06131. How can I normalize this to -1 and 1? Because otherwise it is hard to interpret.

답변 (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