A cardiotocography (CTG) machine, also known as an electronic fetal monitor, is a medical device used to monitor the fetal heart rate and uterine contractions during pregnancy and labor. It provides a continuous recording of these two vital signs on a paper strip or computer screen, allowing healthcare professionals to assess fetal well-being and identify potential distress.