0

I have found information about similar topics, but wasn´t useful for me.

I have the next 2 signals registered by a laser profilometer. enter image description here

As can be seen in the picture the signals are almost equals but are not in phase. What i need is to displace the red signal over the blue one finding the more likely point of union to get a third signal.

I have tried with this code, but it does not work, i obtain zero in the lag, i suspect that it is caused becouse the signals length is the same. I am programming in MATLAB

[acor,lag] = xcorr(p2,p1);

[~,I] = max(abs(acor));

lagDiff = lag(I);

The two signals are attached.

Regards!

  • 2
    your series are non stationary, meaning that xcorr tool doesn't work very well in this situation. you need to remove the trend or do differencing before applying xcorr. – Aksakal Mar 20 '18 at 14:40
  • Please register &/or merge your accounts (you can find information on how to do this in the My Account section of our [help]), then you will be able to edit & comment on your own question. – gung - Reinstate Monica Mar 21 '18 at 11:11
  • I tried with the detrend function and it looks better. Thanks! – Billy Knife Mar 21 '18 at 08:34

0 Answers0