I have the reference Singal ( Ref) and sensor signal ( Sen), the Sen has 23 samples equivalent t0 0.0011 seconds of phase shift delay. I want to plot the error without the phase shift if I do this plot(t, Ref-Sen) it will have a phase shift, plotting them in the time domain without the phase shift was easy by doing plot(t, Ref), hold on plot(t-0.0011, Sen)
I hope these figures can help the reader to understand better, I note most of your answer relevant to this. plot(t,Ref,'b','LineWidth',2) hold on grid plot(t-0.0011,Sen,'b','LineWidth',2) I have managed to get rid of the phase shift in the time domain. I am now trying to plot the error for one period, so I used the following plot(t(7:674),Ref(7:674)-Sen(30:697),'k','LineWidth',2) where sample 7 is the intersection of the Ref with 0 and 30 sample is Sen with zero, you will note still the phase shift occurs in the error plot, I want to plot error without the phase shift.