Cross-correlation in Matlab
Show older comments
Hi,i have foure equation

,and i want to find cross-correlation between two different initial value for the same variable for example x0=1.528121243912454,x0=1.528121243912453 ,apply the function in matlab xcorr but the result i get it is wrong because i observe beak in zero

,how apply thats function and get result without peak?????? file in matlab down
6 Comments
Adam
on 23 Apr 2019
What would you expect to find? If you cross-correlate two signals that are very similar, as with such a tiny change in x or y, then you would expect a lag of 0 to give the highest correlation, by some distance.
huda ali
on 23 Apr 2019
Apparently your solution didn't match that of the referenced paper...can you somehow verify your code reproduces the same identical sequences as those of the authors thereof?
In such calculations, even the tiniest difference in how source code is converted to calculation can change rounding and the result evolve totally differently with iteration owing to such...or, your code may actually have rounding such that the two sequences actually are identical; I didn't check.
Did the authors publish their source code or otherwise document their solution technique to be able to reproduce it? That's where I'd start...I wouldn't suspect the xcorr function to be lying; I'd think the two sequences generated aren't actually different owing to the differences in how were calculated between the two implementations.
huda ali
on 23 Apr 2019
dpb
on 23 Apr 2019
And, of course, which hardware/OS the code is run on can make such differences altho if multiple folks have shown the same result it probably is pointing to something actually in your implementation that doesn't duplicate what they're doing.
So, clearly your solution isn't matching the references, then... start looking there. I noticed you did specific implementation of the integration, you could begin by using the Matlab builtin Runge-Kutta method that is based on widely used library routines packaged and tweaked by TMW; some similar routine is probably what those researchers used...it would at least give you a different solution path than the one you've taken...
Again, also, I didn't do any real looking at your code for possible coding/logic errors that might explain it, either.
huda ali
on 23 Apr 2019
Answers (0)
Categories
Find more on Correlation and Convolution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!