HOW TO KNOW THAT WETHER TWO SIGNLAS ARE SIMILAR OR NOT USING 'XCORR' FUNCTION ????

조회 수: 1 (최근 30일)
Arka Roy
Arka Roy 2019년 9월 7일
답변: Image Analyst 2019년 9월 8일
HOW TO KNOW THAT WETHER TWO SIGNLAS ARE SIMILAR OR NOT USING 'XCORR' FUNCTION ????
on the 1st segment of codei i am using two sine waves and in the output i am getting a peaky neature curve in cross corelation;and again if am using two signals like sine and ramp there also i am getting a peaky neature curve in cross corelation;. Then how can i say that whether two are related or not??? how can we predict that these two signals are corelated or not????
t=0:1/100:10;
y=5*sin(t);
w=sin(t);
subplot(3,1,1);
plot(t,y);
grid on;
subplot(3,1,2);
plot(t,w);
grid on;
%FINDING CROSS CORELATION
t=xcorr(y,w);
subplot(3,1,3);
plot(t);
grid on;

답변 (1개)

Image Analyst
Image Analyst 2019년 9월 8일
I don't know what a "peaky neature curve" is. If you want to know how well two signals correlate on an element-for-element basis, you can use corrcoeff(). If you want to find out where (what shift) one signal overlaps another best, you can use xcorr. There are some things you need to look out for and be aware of, like xcorr() might indicate a shfit where the ends of the signals are shifted and there's only one - they don't overlap. That might be ok if one signal is much smaller, like it's a template, and you want to find out where in a longer signal it appears. But if the two signals are just two arbitrary signals of about the same length, then I think you better think about what you're asking and what you really need.

카테고리

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