For a Markov process in discrete time, having finite covariances, both the transient behaviour and the correlation structure may be summed up in a single generating function, here called the key function. If the process is stationary, and the key function possesses a suitable analytic extension, then the process possesses a continuous spectral density, which can be calculated from the key function. A converse result, and some results for the non-stationary process, are also obtained. The calculation is discussed in more detail for the waiting-time process in the GI/G/1 queue.