Starting from measured data, we develop a method to compute the fine
structure of the spectrum of the Koopman operator with rigorous convergence
guarantees. The method is based on the observation that, in the
measure-preserving ergodic setting, the moments of the spectral measure
associated to a given observable are computable from a single trajectory of
this observable. Having finitely many moments available, we use the classical
Christoffel-Darboux kernel to separate the atomic and absolutely continuous
parts of the spectrum, supported by convergence guarantees as the number of
moments tends to infinity. In addition, we propose a technique to detect the
singular continuous part of the spectrum as well as two methods to approximate
the spectral measure with guaranteed convergence in the weak topology,
irrespective of whether the singular continuous part is present or not. The
proposed method is simple to implement and readily applicable to large-scale
systems since the computational complexity is dominated by inverting an
$N\times N$ Hermitian positive-definite Toeplitz matrix, where $N$ is the
number of moments, for which efficient and numerically stable algorithms exist;
in particular, the complexity of the approach is independent of the dimension
of the underlying state-space. We also show how to compute, from measured data,
the spectral projection on a given segment of the unit circle, allowing us to
obtain a finite-dimensional approximation of the operator that explicitly takes
into account the point and continuous parts of the spectrum. Finally, we
describe a relationship between the proposed method and the so-called Hankel
Dynamic Mode Decomposition, providing new insights into the behavior of the
eigenvalues of the Hankel DMD operator. A number of numerical examples
illustrate the approach, including a study of the spectrum of the lid-driven
two-dimensional cavity flow.