Text this: Two algorithms for estimating the period of a discrete signal