Illustration of how the degree to which two IMU signals are in-step can measured directly as their correlation.
library(rafalib)
T <- 0.5
t <- seq(0,1.7,0.02)
y <- sin(2*pi*t/T)
mypar(5,2)
for (d in seq(0,pi,length.out=10)){
y2=sin(2*pi*t/T+d)
plot(t,y,type="l",xlim=c(0,2), xlab="time (s)", ylab="Acceleration")
lines(t,y2,type="l", col="red")
text(1.9,0.75,paste("cor= ",round(cor(y,y2),2)),cex=0.9,col="blue")
}