フィルターのクリア

how to calculate normalized cross correlations for two signals ????

38 ビュー (過去 30 日間)
mostafa haggag
mostafa haggag 2018 年 5 月 3 日
hello
I hope you are doing well and fine
i have two arrays of data for two different signals
i want to compare them using cross correlations
xcorr method is used to get the correlation value and then lag value and i plot it using this code
[tmpr lags]=normxcorr2(powersignal1,power_b_int);
[tmpr1 lags1]=normxcorr2(powersignal1,powerT1);
my problem is that i want to do a normalized cross-correlation as it is more exact and gives better results however i do not know how to do so
is there a function in Matlab that does normalized cross-correlations calculations for different lags and return the results ??
i have been searching for a while yet i could find any
i know the formula for calculating the normalized cross-correlations but hoped for a prepared method to use right a way instead of writting the method thank you so much

採用された回答

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy 2018 年 5 月 3 日
Check this, where x and y are two vector with length N.
if true
Normalised_CrossCorr = (1/N)*sum((x-mean(x))*(y-mean(y)))/(sqrt(var(x)*var(y));
end
  3 件のコメント
Rohan Dekate
Rohan Dekate 2020 年 12 月 17 日
Hi
I implemented this for a sensor signal and a modelled signal, and got 0.847 as the answer. Correct me if I'm wrong in understanding the concept -
If the Normalized Cross Correlation is 1 it means that the two signals are matching each other and if it is 0 then they are not matching at all. Because it is normalized the answer will be between 0 and 1.
However, I have a simulink model from which I'm generating two signals as output. When I implemented the above formula I got 623700 as my answer which is not plausible at all. Can you tell me what has gone wrong?
Vasanthi Ravindran
Vasanthi Ravindran 2022 年 2 月 4 日
Hi Yuvaraj Sir ,
Can you kindly send the formula for Normalised Cross Correlation

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by