  Koopman operators globally linearize nonlinear dynamical systems and their
spectral information is a powerful tool for the analysis and decomposition of
nonlinear dynamical systems. However, Koopman operators are
infinite-dimensional, and computing their spectral information is a
considerable challenge. We introduce measure-preserving extended dynamic mode
decomposition ($\texttt{mpEDMD}$), the first truncation method whose
eigendecomposition converges to the spectral quantities of Koopman operators
for general measure-preserving dynamical systems. $\texttt{mpEDMD}$ is a
data-driven algorithm based on an orthogonal Procrustes problem that enforces
measure-preserving truncations of Koopman operators using a general dictionary
of observables. It is flexible and easy to use with any pre-existing DMD-type
method, and with different types of data. We prove convergence of
$\texttt{mpEDMD}$ for projection-valued and scalar-valued spectral measures,
spectra, and Koopman mode decompositions. For the case of delay embedding
(Krylov subspaces), our results include the first convergence rates of the
approximation of spectral measures as the size of the dictionary increases. We
demonstrate $\texttt{mpEDMD}$ on a range of challenging examples, its increased
robustness to noise compared with other DMD-type methods, and its ability to
capture the energy conservation and cascade of experimental measurements of a
turbulent boundary layer flow with Reynolds number $> 6\times 10^4$ and
state-space dimension $>10^5$.
