I have values from two sensors stored in two vectors A and B. They both represent values of the sensors at times TA and TB which is stored in two other vectors(since it is not uniform sampling) Both A and B represent the same data but A is shifted a bit to the right because of the delay in starting the sensors.
My question is, how do I calculate this delay and more importantly, how do I shift A to match B or vice versa, such that I can do a one-to-one correspondence of the data?
Right now, I am finding the peak of the cross-correlation function of A and B to find the offset (in number of samples, not time) and padding the arrays with zero upto that number, but I am 100% sure that is wrong. Problem is, I don't know how else.
PLEASE help!
Thanks!