I am trying to understand code written by my predecessor. Rather than using a xcorr in MATLAB, she did the following. Apparently this seems to working. I would really appreciate if someone could explain, what is happening here. She is saying the pattern is symmetric by calculating the variable sym below, in the code below.
close all hidden
t = 0:0.01:2*pi;
x = sin(t)
plot(x,'k')
mu = mean(x)
sigma = std(x)
y = (x-mu)/(sigma);
hold on
plot(y,'r')
yrev = y(end:-1:1);
hold on
plot(yrev)
hold on
sym = sum(y.*yrev/length(y))
plot(y.*yrev/length(y),'r*')