Why is not cross-correlation symmetric with respect to zero?

16 views (last 30 days)
Hello! /p I need to create a harmonic signal, then to add some noise and to calculate auto cross-correlation. I know that auto cross-correlation must be symmetric with respect to zero. In two following pictures there are my code and the result that I get. How can I make it symmetric?

Answers (1)

Image Analyst
Image Analyst on 22 Oct 2017
When you cross correlate, the final signal length is the sum of the two signal length. You'll need to keep track of where the "zero" x location is. Like for the main signal, if it's centered about x=0 and has N elements, then the x=0 location is around N/2. So for your x array, x(1) is really -N/2 and x(N) is really N/2. Same concept for cross correlation. If both your signals are symmetric with respect to x, then your final signal will go from -(N+M)/2 at x(1) to +(N+M)/2 at the final element x(end).

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!