DSPRelated.com
Forums

basic question about cross correlation

Started by drewsky77 April 9, 2009
Hello,

I have a basic question about cross correlation. From the wikipedia article, cross correlation is defined for 2 continuous functions f, g as

(f * g) (n) = \integral_{-inf}^{inf} f(t) g(t+n) dt

So we're basically shifting g and finding the lag (or n) for which the 2 functions match up best. This is intuitively how I understand cross correlation from reading the wikipedia article.

But what if f,g are the same exponential function? Say, exp(x).

Then, if we shift g to the left by some amount n, at every x, g(x) > f(x), which means that for any lag which shifts g to the left, (f * g)(n) > (f * g) (0), the cross correlation value will be greater than when the lag is 0. But the cross correlation for 2 identical functions should be highest when n = 0 right?

What am I missing?

thanks.
integral (-inf, inf) exp(t).exp(t) dt does not converge. So for an exp(t),
where t = -inf to inf, I don't think your definition of autocorrelation
works any more. In fact, the situation you cite, i.e. the shifted function
is always greater than the unshifted function will only work for
monotonically increasing functions and in those cases, I think, the integral
for the autocorrelation won't converge and so we can't even ask the question
of whether the autocorrelation at lag 0 is highest.

If you truncate exp(t), e.g. if you were to calculate the xcorr() in Matlab
with a finite length vector, then zero-padding the ends will ensure that you
won't have the property where the shifted function is always greater than
the unshifted function.

I think thats the answer...
On Wed, Apr 8, 2009 at 4:18 PM, drewsky77 wrote:

> Hello,
>
> I have a basic question about cross correlation. From the wikipedia
> article, cross correlation is defined for 2 continuous functions f, g as
>
> (f * g) (n) = \integral_{-inf}^{inf} f(t) g(t+n) dt
>
> So we're basically shifting g and finding the lag (or n) for which the 2
> functions match up best. This is intuitively how I understand cross
> correlation from reading the wikipedia article.
>
> But what if f,g are the same exponential function? Say, exp(x).
>
> Then, if we shift g to the left by some amount n, at every x, g(x) > f(x),
> which means that for any lag which shifts g to the left, (f * g)(n) > (f *
> g) (0), the cross correlation value will be greater than when the lag is 0.
> But the cross correlation for 2 identical functions should be highest when
> n = 0 right?
>
> What am I missing?
>
> thanks.
>