in reply to Re^3: Calculating cross-correlation
in thread Calculating cross-correlation

Isn't the point of cross-correlation to determine if two datasets are, or approximate to, being described by the same series, but with different offsets?

Therefore the OPs talk of "two series" is correct until the determination is made that they might actually be the same series.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

Replies are listed 'Best First'.
Re^5: Calculating cross-correlation
by Anonymous Monk on Nov 25, 2010 at 16:11 UTC
    The point of cross-correlation is to determine if two signals are similar or not and to which degree. If they are different, no matter the offset, the cross-correlation value will be very small (close to 0). In the case of auto-correlation, the signal is cross-correlated to itself. So, it will be always picked (1.0) at 0 lag.
      The point of cross-correlation is to determine if two signals are similar or not

      In other words, prior to having made the determination, the OP is perfectly correct in saying "two series", because at that point in time he doesn't know if they are related. That's why he is running the cross-correlation.

      So, you are agreeing with me. Thanks.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        I can not agree with you because what you are saying is obviously not correct. The two series (signals, functions) are not the same, they are defined as two different entities. For example, lets consider that you would like to know if the earthquake activity is correlating or not with the earth tides. You will run a cross-correlation analysis between these two series (supposing you have such data). If they correlate you may conclude that earthquakes might be triggered (in some situations) by earth tides. But again, the tides and earthquakes are different things! Have a nice day.
Re^5: Calculating cross-correlation
by anonymized user 468275 (Curate) on Nov 25, 2010 at 16:38 UTC
    Actually, he has to provide the offset on one and then instead of cross-correlating with the original he has to (standard-) correlate that result with the other. I know enough to provide a better answer now...

    One world, one people

      Actually, he has to provide the offset on one

      Actually, no. Cross correlation can be used to determine the required offset.

      From the Wikipedia page (my emphasis):

      Explanation

      For example, consider two real valued functions f and g that differ only by an unknown shift along the x-axis. One can use the cross-correlation to find how much g must be shifted along the x-axis to make it identical to f.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        It's only an example and it doesn't work for the OP, only for theoretical functions. For actual signals you need to iterate the phase as you would in cross-correlation but then you have to standard-correlate the shifted version of f because f and g won't be identical. I've sketched what I mean as code in a reply to the OP. Just accept it, cross-correlation is a correlation where the second series is a derivation of the first using a MATHEMATICALLY SIMULATED SHIFT. Standard correlation uses two independently sourced series so if one is only theoretically or potentially a copy of the other shifted instead by say circuitry instead of maths you have to use standard correlation.

        Update: although if in some weird situation, one mathematician supplies another with a mathematically shifted pair of identical sets without specifying the shift then the same technique of iterated correlation is required. Which reminds me, there is a factor not taken into account -- potential decay of one of the signals.

        One world, one people