# Autocorrelation of a telegraph process/constant signal

I am trying to calculate the autocorrelation function for the telegraph process, but I somehow don't get the right results.

I am calculating the correlation function of a signal X which can take values 0 and 1 by calculating the spectral density $S(\omega)=|FFT(X)|^2$. The autocorrelation function is then given by the inverse fft of the spectral density $iFFT[S(\omega)](\tau)$.

If I do this the autocorrelation functions never drops down to zero for $\tau \rightarrow\infty$.

Indeed if I take a constant signal $X = 1$, the autocorrelation should be $0$. But if I use the steps mentioned above the autocorrelation function will give $1$ instead.

I really don't understand this, could you explain why I get these results?

-
The FFT assumes periodicity in the time domain and so, using it to calculate the power spectral density of a telegraph signal is not going to give the right answers. – Dilip Sarwate May 29 '14 at 19:03
For anyone who has the same problem: There are different definitions for the autocorrelation function. One is <X(t)X(t-tau)> the another one is <X(t)X(t-tau)> - <X>^2. I used the second one. The Wiener Khinchin theorem is usually stated without the average, then you get an offset from zero for long times. If you subtract the average, the ensemble average should drop down to zero for signals without long time correlations. – physicsGuy Jun 10 '14 at 13:02

The random telegraph signal with parameter $\lambda$ is derived from a Poisson process of arrival rate $\lambda$. In the Poisson process, the number of arrivals in $(t_1, t_2]$ is a Poisson random variable with parameter $\lambda(t_2-t_1)$. Consider counting the Poisson arrivals in $(0,\infty)$ with a digital counter whose least significant bit (LSB) is $0$ or $1$ with equal probability at time $t=0$. The random telegraph signal is just a model for the value of the LSB, or rather for the value of $(-1)^{\text{LSB}}$ which has value $+1$ or $-1$ according as the LSB is $0$ or $1$.

The random telegraph signal is a random process (collection of random variables) $\{X_t \colon 0 \leq t < \infty\}$ where each $X_t \in \{+1,-1\}$ and $X_0$ is equally likely to be $+1$ and $-1$. For any $t_2 > t_1 \geq 0$, the number of arrivals in $(t_1,t_2]$ is Poisson with parameter $\lambda(t_2-t_1)$ and thus is an even number with probability $\exp(-\lambda(t_2-t_1))\cosh(\lambda(t_2-t_1)) = \frac 12 + \frac 12 \exp(-2\lambda(t_2-t_1))$. It follows that the LSB is in the same state at time $t_2$ as it was at time $t_1$, that is, $X_{t_2} = X_{t_1}$ with probability $\frac 12 + \frac 12\exp(-2\lambda(t_2-t_1))$ while $X_{t_2} = -X_{t_1}$ with probability $\frac 12 - \frac 12\exp(-2\lambda(t_2-t_1))$. It is readily verified that $P\{X_t = +1\} = P\{X_t = -1\} = \frac 12$ and so the process has mean function $0$ while the autocorrelation function is

\begin{align}R_X(t_1,t_2) &= E[X_{t_1}X_{t_2}]\\ &= (+1)\left[\frac 12 + \exp(-2\lambda(t_2-t_1))\right] + (-1)\left[\frac 12 - \exp(-2\lambda(t_2-t_1))\right]\\ &= \exp(-2\lambda(t_2-t_1))\end{align}

which is a function of the time difference only. Thus

The random telegraph signal is a zero-mean WSS process with autocorrelation function $R_X(\tau) = E[X_tX_{t+\tau}]= \exp(-2\lambda \tau)$ and its power spectral density is of the form of a Cauchy density function.

It is worth emphasizing that if one takes a finite segment of an actual realization or sample path of a random telegraph signal, one does not get the nice and smooth autocorrelation function described above but rather a piecewise linear function that decays away slowly.

So, can we get any of this from a DFT? The answer is that we could get an approximate answer, but we need to take care in setting up the problem.

The random telegraph signal shifts back and forth between $+1$ and $-1$ at random times. Thus, when we take $N$ samples spaced $T$ seconds apart of a realization of this signal, each sample value is $+1$ and $-1$, but since this is not a band-limited signal, the samples cannot be used to reconstruct the realization at all. Note also that unless $T$ is carefully chosen to be quite small so that we can be virtually certain (i.e. with very high probability) that there is at most one transition from $+1$ to $-1$ (or vice versa), we will have missed a lot of the nuances (a.k.a transitions) in the signal. But, if $T$ is very very small and $N$ is very very large, our time-domain vector will have reasonably long runs of consecutive $+1$s or consecutive $-1$s during which interval there are no transitions at all.

Now, the autocorrelation function that we need is the aperiodic autocorrelation function, and not the periodic autocorrelation function, and so we need to zero-pad our signal vector of length $N$ with $N-1$ or more $0$s (say $N$ for concreteness) and compute the DFT of this vector of length $2N$. An FFT algorithm could be used for this. Now $|X[k]|^2$ will roughly resemble the Cauchy spectrum of the random telegraph signal.

-
What I don't get is the following: Assume that $\lambda = 0$. Then according to your calculation $R_X = E[X_{t_1}X_{t_2}] - E[X]^2 = 1 - 1 = 0$. What I don't get is why you can't use the Wiener Khinchin theorem here. It tells you that the autocorrelation function is the fourier transform of the spectral density, as described in my question. Still for a constant signal $X = 1$, if I calculate it this way R_X = iFFT( S[X] ) = 1. Why? – physicsGuy May 30 '14 at 6:21
I guess the reason is that the fourier transform does not exist. But this means that if I have a signal with a nonzero expectation value I cannot calculate the autocorrelation function in a way that I described it, doesn't it? – physicsGuy May 30 '14 at 8:07
The case $\lambda=0$ is trivial since there are no Poisson arrivals and so $X_t$ is the same ($+1$ or $-1$ as the case maybe) for all $t$. The sampled values of any sample path will give a DFT showing a nonzero DC value and $0$ entries in all other bins, and the iDFT will give you the sample path back again. Yes, the Wiener-Khinchin Theorem does apply even in this trivial case. – Dilip Sarwate May 30 '14 at 12:54