# Cross correlation

**URL:** <https://community.wolfram.com/t/cross-correlation/3370>\
**Category:** Questions\
**Tags:** engineering, image-processing, signal-processing, wolfram-cloud\
**Created:** [September 21, 2014, 10:04am UTC](https://community.wolfram.com/t/cross-correlation/3370 "2014-09-21T10:04:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manugaurav](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/manugaurav/32/12626_2.png) [@manugaurav](https://community.wolfram.com/u/manugaurav)\
**Post date:** [September 21, 2014, 10:04am UTC](https://community.wolfram.com/t/cross-correlation/3370/1 "2014-09-21T10:04:23Z")

</div>

I am trying to do cross correlation. Following is the program, I am trying to run

```
y2={1,2,3,4,5,6,7,8}
ListCorrelate[y2,y2]
Correlation[y2,y2]

```

since y2 is 8 element array, I should get a vector output of a 17 element array, but I am getting a single value in both cases. Can I get a suggestion on how to proceed further?

---

<div class="post-metadata">

**Author:** ![dreiss](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dreiss/32/29094_2.png) [@dreiss](https://community.wolfram.com/u/dreiss)\
**Post date:** [September 21, 2014, 3:42pm UTC](https://community.wolfram.com/t/cross-correlation/3370/2 "2014-09-21T15:42:06Z")

</div>

The simplest version of ListCorrelate, ListCorrelate[ker,list], only runs the kernel with respect to the list across the range where there is no overlap with the end points. But there are a variety of additional argument forms that allow additional behaviors.

As you read though the documentation you will come across this form:

```
ListCorrelate[y2, y2, {-1, 1}, 0]

```

this allows maximal overhang at both ends of the kernel (y2 in your case) with the list (y2 as well) and pads the ends past the overhang with 0s.  
This gives

```
{8, 23, 44, 70, 100, 133, 168, 204, 168, 133, 100, 70, 44, 23, 8}

```

---

<div class="post-metadata">

**Author:** ![manugaurav](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/manugaurav/32/12626_2.png) [@manugaurav](https://community.wolfram.com/u/manugaurav)\
**Post date:** [September 21, 2014, 4:45pm UTC](https://community.wolfram.com/t/cross-correlation/3370/3 "2014-09-21T16:45:16Z")

</div>

hi david

thankyou, it worked

regards  
manu
