Development of an EEG artefact detection algorithm and its application in grading neonatal hypoxic-ischemic encephalopathy