Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- offset = 150;
- a = rand(1, 500);
- b = a(1 : end - offset) + rand(1, numel(a) - offset);
- c = a(offset + 1 : end) + rand(1, numel(a) - offset);
- close all
- figure
- plot(1:numel(b), b);
- hold on
- plot(1:numel(c), c, 'r');
- [crossCorr] = xcov(b, c);
- [~, peakIndex] = max(crossCorr())
- offset = peakIndex - length(b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement