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

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.
RIP an inspiration; A true Folk's Guy

Replies are listed 'Best First'.
Re^7: Calculating cross-correlation
by anonymized user 468275 (Curate) on Nov 26, 2010 at 12:01 UTC
    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