3
$\begingroup$

This is the function:

$$ x(n) = \begin{cases} 1, & \text{-N $\leq$ n $\leq$ N ;}\\ 0, & \text{otherwise.} \end{cases} $$

And I tried to solve it, using sigma notation or summation:

\begin{equation} \ r_{xx}(l) = \displaystyle\sum_{n=-\infty}^{\infty} x(n)x(n-l) \end{equation}

I get 2N-1 but that is wrong. Because when I do the autocorrelation in MATLAB I get something like: For exmple if N = 2, the discrete function rxx(l) would be like:enter image description here

Which is something like rxx(l) = 2N-1+|l| But I don't know how to get there... Can you help me?

$\endgroup$
  • $\begingroup$ In your definition $\displaystyle r_{xx}(l) = \displaystyle\sum_{n=-\infty}^{\infty} x(n)x(n-l), $ for $l = 3$ and with $N=5$, say, can you list all the nonzero terms in that sum $r_{xx}(3)$? If you think this is too much work, how about just the value of $x(6)x(6-3)$ and $x(5)x(5-3)$? $\endgroup$ – Dilip Sarwate Jun 8 '15 at 2:34
3
$\begingroup$

Calculating the autocorrelation of this function is relatively easy. You just need to follow the formula you have written:

\begin{equation} \ r_{xx}(l) = \displaystyle\sum_{n=-\infty}^{\infty} x(n)x(n-l) \end{equation}

It gets much easier because your function is $\neq0$ for only a few values ($2N+1$ exactly).

Because of this the previous sum can be replaced with this much simpler one:

\begin{equation} \ r_{xx}(l) = \displaystyle\sum_{n=-N}^{N} x(n-l) \end{equation}

Which is basically just counting how many times $x(n-l)$ is not zero on that finite interval. Because of this it appears easily that

\begin{equation} r_{xx}(l)=max(2N-1-|l|,0) \end{equation}

You almost had it in your question but the sign was wrong.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.