  This paper introduces a simple yet powerful approach based on topological
data analysis (TDA) for detecting the true steps in a piecewise constant (PWC)
signal. The signal is a two-state square wave with randomly varying
in-between-pulse spacing, and subject to spurious steps at the rising or
falling edges which we refer to as digital ringing. We use persistent homology
to derive mathematical guarantees for the resulting change detection which
enables accurate identification and counting of the true pulses. The approach
is described and tested using both synthetic and experimental data obtained
using an engine lathe instrumented with a laser tachometer. The described
algorithm enables the accurate calculation of the spindle speed with the
appropriate error bounds. The results of the described approach are compared to
the frequency domain approach via Fourier transform. It is found that both our
approach and the Fourier analysis yield comparable results for numerical and
experimental pulses with regular spacing and digital ringing. However, the
described approach significantly outperforms Fourier analysis when the spacing
between the peaks is varied. We also generalize the approach to higher
dimensional PWC signals, although utilizing this extension remains an
interesting question for future research.
