Group Abstract Group Abstract

Message Boards Message Boards

0
|
9.3K Views
|
2 Replies
|
1 Total Like
View groups...
Share
Share this post:

[?]  Simplest method for computing cross correlation?

I have two lists, x and y, of equal length, Nx, and I wish to construct the cross-correlation of the two. To compute the autocorrelation of just x (or y) I simply used

Rxx = CorrelationFunction[x, {Nx - 1}]

For the cross-correlation, I first attempted to construct a function using the following:

Rxy[n_] = Sum[x[[m]]*y[[m + n]], {m, 1, Nx - n}],

where n denotes the prescribed lag. This resulted in an error message "The expression m cannot be used as a part specification."

I'm not sure as to what this error means. Also, is there a simple way to use the ListConvolve function to create the desired cross-correlation? (I'm a bit confused by the description at http://reference.wolfram.com/language/ref/ListConvolve.html)

POSTED BY: Paul Fishback
2 Replies
POSTED BY: Marco Thiel
POSTED BY: Paul Fishback
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard