Text this: Adaptive template matching of photoplethysmogram pulses to detect motion artefact