There are 2 signals A(t), B(t) representing output power. A is a time delayed output. How to implement this formula
Cross_cor(delay)=[A(t + delay) − <A(t)>]*[B(t) − <B(t)>] / {[A(t)-<A(t)]^2 * [B(t)-<B(t)]^2} ^2
- I do not understand what the numerator implies?
- How to plot a color map or something like the surf plot whereby the different regions can be seen with different colors.
- How to obtain a plot of the cross correlation as a function of the delay shift time (delay X axis, Cross_corr on Y axis) so that the peak can be visualized?
I’m gonna say [X] is the mean of X then:
The numerator is taking two functions A(t) and B(t) and centering them, this is what subtracting the mean does. I can create two new functions that make this all look a little bit easier:
then:
Now I’m muliplying these two functions and taking the mean. If these two functions are moving exactly with one another this is going to be 1 which mean positive correlation.
You can do this in Matlab by doing the following:
This give me the crosscor at dt = 0, for another dt do: