# Autocorrelation of a Shifted Sequence

Suppose I have a sequence $x[k]$ with $\mathcal{Z}$-transform

$$X(z) = x_{0} + x_{1}z^{-1} + x_{2}z^{-2} + \ldots + x_{N-1}z^{N-1}$$

I know that for real-valued $x[k]$ the $\mathcal{Z}$-transform of the autocorrelation of $x[k]$ is given by:

$$S_{XX}(z) = X(z) X(z^{-1})$$

Now suppose I shift the signal by $n$:

$$\tilde{X}(z) = z^{-n}X(z)$$

Would the $\mathcal{Z}$-transform of the autocorrelation simply be:

$$S_{\tilde{X}\tilde{X}}(z) = z^{-n}X(z) z^{ n}X(z^{-1})$$ $$S_{\tilde{X}\tilde{X}}(z) = X(z) X(z^{-1})$$ $$S_{\tilde{X}\tilde{X}}(z) = S_{XX}(z)$$

However when I use the sequence $x[k] = \{ 1, 1, -1\}$, shift it by $n=2$ to get $\tilde{x}[k] = \{0, 0, 1, 1, -1\}$, I get:

$$R_{\tilde{X}\tilde{X}}[k] =\mathcal{Z}^{-1}\{S_{\tilde{X}\tilde{X}}(z)\} = [0, 0, -1, 0, 3, 0, -1, 0, 0]$$

Which is equivalent to $S_{\tilde{X}\tilde{X}}(z) = z^{-2} S_{XX}(z)$ instead of

$$R_{{X}{X}}[k] = [-1, 0, 3, 0, -1]$$

So how is my math wrong? What is the autocorrelation of a shifted sequence in relation to the original autocorrelation?

• you want to be more clear in your head and in your notation what is a time-domain "sequence" and what is its frequency-domain transform. and what is "autocorrelation" and what is multiplication. there are some partial truths stated in the premise of your question, but some of us here are leary of attempting to answer questions standing on premises that are not accurate. – robert bristow-johnson Feb 27 '18 at 20:28
• I tried to correct the notation in your post because you mixed time domain and Z-transform domain in a confusing way, as already mentioned by Robert. – Matt L. Feb 28 '18 at 7:35

Your math is not wrong. It's true that the autocorrelation will not change if you shift the signal. You've probably computed the autocorrelation using some tool like Matlab/Octave, and the misunderstanding lies in the implicit indexing. The lag indices corresponding to your first result [−1,0,3,0,−1] are in the range $[-2,2]$, whereas the lag indices of your second result [0,0,−1,0,3,0,−1,0,0] are in the range $[-4,4]$. So both results are equivalent as predicted by you. In Matlab/Octave the function xcorr has a second output argument lags which gives you the lags at which the correlation is computed.

[r,lags] = xcorr([1,1,-1])

gives

lags = -2 -1 0 1 2

whereas

[r,lags] = xcorr([0,0,1,1,-1])

gives

lags = -4 -3 -2 -1 0 1 2 3 4

Hi: I think there are two different vewpoints to your question so I'll mention both.

First Viewpoint: ( Time Domain )

What you have written for the covariance is not wrong but you need to understand what you're calculating. Those numbers you are calculating are unscaled covariances of an MA(n) process assuming A) that the variance of the noise term in the MA(n) model, $\sigma^2$ = $1$ and B) the coefficients of the MA(n) model ( i.e: the $\theta$ ) are all 1. So, the covariance of the shifted MA(n)series does stay the same because the 5 numbers ( A) the variance and B) the 2 autocovariances at lags 1 and lag 2 and lag -1 and lag -2 which are happily symmetric ) are staying the same. You get the other zeros because, for some reason, when you shifted the sequence in the time domain, some extra zeros arose. I'm not sure how that happened but it shouldn't. atleast not in the time domain.

Second viewppoint ( Frequency domain )

I'm just learning DSP so can't say a lot here but, from a time series frequency domain perspective, if $y$ has covariance generating $g_{y}(z)$, then that $X(z)$ filter can be viewed as an MA filter of order(n) so that if the MA(n) filter is applied to $y(t)$, resulting in say, $X(t)$, then the covariance generating function of $X(t) = B(z)B(z^{-1}) g_{y}(z)$ where $g_{y}(z)$ is the autocovariance generating function of $y$.

All of this quite nicely covered in Hamilton's "Time Series Analysis" if you have that book. I highly recommend it for time-series but it's mostly time domain material with frequency domain coverage somewhat scattered. Still, book is really great.