  Persistent homology (PH) is a recently developed theory in the field of
algebraic topology to study shapes of datasets. It is an effective data
analysis tool that is robust to noise and has been widely applied. We
demonstrate a general pipeline to apply PH to study time series; particularly
the instantaneous heart rate time series for the heart rate variability (HRV)
analysis. The first step is capturing the shapes of time series from two
different aspects -- {the PH's and hence persistence diagrams of its} sub-level
set and Taken's lag map. Second, we propose a systematic {and computationally
efficient} approach to summarize persistence diagrams, which we coined {\em
persistence statistics}. To demonstrate our proposed method, we apply these
tools to the HRV analysis and the sleep-wake, REM-NREM (rapid eyeball movement
and non rapid eyeball movement) and sleep-REM-NREM classification problems. The
proposed algorithm is evaluated on three different datasets via the
cross-database validation scheme. The performance of our approach is better
than the state-of-the-art algorithms, and the result is consistent throughout
different datasets.
