Dynamic programming beat tracker.

Beats are detected in three stages, following the method of