Info

This question is closed. Reopen it to edit or answer.

Error in Calculation Correlation using loop and inbuilt function

1 view (last 30 days)
I am trying to do correlation of two signals. (Just the positive part of correlation i.e. from 0 to L not _L to L) I have attached the mat files for 2 signals. When I use xcorr or xcorr2 function, I get invalid results. P_i is from 1 to 50 samples only. P_o is from 1 to 1050 samples only. So when I do their correlation, the correlation should be from 1 to 1050 only. But by using xcorr and xcorr2, I am getting a value at 1051 and onwards samples. The correlation is working fine when I use a loop.
I want to use the inbuilt functions to optimize my system as the loop is taking a lot of time.
Can someone please explain why is this happening and what to do to encounter this. I have attached the required files Thank you.

Answers (0)

Community Treasure Hunt

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

Start Hunting!