"Although these data are derived from sheep, this species has been a useful investigative model of human pregnancy and the extrapolation of these data to the human fetus is plausible. Being asleep or awake is not as easy to distinguish in the fetus and newborn as it is in adults but the broad categories can still be classified on the basis of EEG recordings. On this basis, sleep state differentiation appears in humans as early as 25 weeks in preterm infants and is complete at 30 weeks. EEG recordings in late fetal baboons support these observations and define only two physiological states from EEG analysis, quiet sleep and active sleep. While the lack of fetal movement during anoxic stress in sheep may not be the same as the response to acute surgical tissue damage in humans, this work does highlight the important differences between fetal and neonatal life and the potential pitfalls of extrapolating from observations of newborn preterm infants to observations of the fetus. Sedation of the fetus and suppression of cortical arousal in times of stress imply that the cortex in utero responds differently from the neonatal cortex and that it is only after birth, with the separation of the baby from the uterus and the umbilical cord, that wakefulness truly begins. This conclusion is not inconsistent with reports of fetal conditioning and habituation to repeated exposure of sounds and smells in late pregnancy which are often referred to as fetal learning. Such responses do not require a cortex in a state of wakefulness and can be induced in simple circuits in lower organisms."
January 1, 1970
https://en.wikiquote.org/wiki/Wakefulness