Cross-correlation, sharp peak at 0?
Since your shift is going to be in the 0-5 pixel range, I am assuming you are going to want a method that gives you sub-sample accuracy.

I have a suggestion for you to try.  Read my article Exponential Smoothing with a Wrinkle and apply the technique to your 1D signal.  Look for some matching zero crossings in the difference case near the center of your data frame.  You should be able to determine the zero crossing by linear interpolation of the two nearest points, or do linear regression on the nearest four or five.  The linear interpolation should be sufficient.  You should be able to measure the shift at several zero crossings. If it is a true shift, all the values you calculate should be the same.  Average them for noise mitigation.

This method is easy to code and takes way fewer calculations than the method you are using.

BTW, that is a very good presentation of your question.

Ced