필터 지우기
필터 지우기

how to calculate time lag from cross correlation data for 365 days?

조회 수: 5 (최근 30일)
AA
AA 2021년 5월 16일
답변: Asvin Kumar 2021년 6월 25일
Dear All,
I am sorry if this question is too basic.
I calculated the Cross-correlation function for 365 days (each day devided into 2 segments). Now I want to calculate the lag time by keeping first as a reference.
I know it is simple if we have two function.
I have max 300 seconds as lag time on each sides (positve and negative) and total number of data poitns are 3001*1 as shown in attached picture.
How can i calculate the lag time for each day?

채택된 답변

Asvin Kumar
Asvin Kumar 2021년 6월 25일
I'm not a 100% clear on what you're trying to achieve but this sounds like a good use case for xcorr. You can look at the usage with the xcorr(x, y, maxlag) syntax. You can skip the second argument in the call to xcorr to calculate auto-correlation.
If it suits your use case, you can perform a max operation on the output from xcorr to identify the lag which gives the highest correlation value. Here's an example of that in the 2D case although the same principles will apply in the 1D case as well: Align two images using cross-correlation

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