During all my pregnancies I always wondered how are fetus sleep/non-sleep periods related to my own sleep. And how my own sleep is related to the baby brain development and affecting the kid in general. Now it is my third pregnancy. I have way more work as a researcher, two kids already occupying me during the day and waking me to prepare them breakfast in the morning (somehow always too early) and there are too many nights when I just get too little sleep. It seems as the proper time to finally explore the effects of my behavior in detail and try to understand this hidden secret which is happening somewhere inside my growing belly. Is it anyhow harmful for the kid when I do not sleep enough as it still can happily sleep its 90% of time, or is my tiredness affecting the kid’s development by different substances floating to the womb or via changes in hormone levels in my body? Does the kid’s brain develops differently during my sleep and during my awakened periods? Another interesting thing for me was that the small baby in my womb seemed to move more when I was resting and its movements seemed almost unnoticeable when I was hiking or being anyhow active. When and how it actually sleeps and how it might feel?
How sleep deprivation affects adults is quite known and there are many resources on this topic. It has been shown that prolonged sleep restriction (less than 6 hours per night) or prolonged extended sleep duration (more than 9 hours of sleep per night) are associated with increased mortality . But how it affects the fetus, is way more hidden secret. So let’s dwell to this fascinating topic…
Sometimes we think about a fetus and newborn as two totally separate beings. Or at least for me, the kid which is still in my womb is totally different from the newborn which will come out and start being hearable and touchable. There are those moments, which make the unborn baby more present for me – like the ultrasonic or when you feel the baby kicking. Anyway, at least for me, the baby in the womb is still very silent creature, which is difficult to understand. Sometimes I have a feeling that it is just the belly, sickness, tiredness and so on, which I have to deal with, forgetting, that inside is a new small human being growing. The current neuroscience research reveals more and more about what is happening inside the womb during the pregnancy. And it is indeed fascinating story. As measuring the fetus brain activity in the womb is very challenging (there exist fetus fMRI , or fetal EEG measurements from scalp of a baby during labor or from mother abdomen , but these measurements are very prone to noise and the interpretation of the data is very challenging), we are mainly restricted to external explorations. It seems that all the way long from the week first till the delivery, there is a continuous process of cognitive development of the kid – not only preparing the physical body, body and brain cells, not only developing digestion, training breathing and motorics, but also improving voice recognition, language development, learning and memory, other cognitive functions, and maybe even dreaming. This process continuously follows to a newborn stage. There is no strict border between a fetus and a newborn.
And same it is with the sleep. The baby in the womb spends almost all the time asleep. As it approaches 32 weeks, it still sleeps 90-95% of the day. Every week the amount of sleep is a bit reduced and at delivery time, they sleep around 85-90% of the day, which is the same time, as the newborn will sleep when coming out of the womb. It might be, that during sleep the fetus is even dreaming as it spends some time in REM phase of the sleep with eyes moving quickly back and forth. “Around the seventh month of a fetus’ development, the first rapid eye movements are seen. The brain of the developing embryo appears to cycle every 20 to 40 minutes between REM sleep, in which brain activity rivals that of consciousness, and non-REM sleep, in which the brain rests.” Swab  explored the fetus of a sheep and came to the conclusion that “Sleep does not suddenly evolve from a resting brain. Sleep and sleep state changes are active regulated processes,” How are these different stages of the brain activity important for the brain development is still a research question. “Cyclic changes in the activity of neurons, for instance, may stimulate the other nerve cells to find and connect with each other to set up complex networks in the brain.”
You can see visualisation of fetus sleep cycles by 26th to 30th week of pregnancy on this video:
It is known that sleep and its individual stages are important for fetal and early neonatal brain development, including development of the neurosensory and motor systems, for learning and memory in the fetus and neonate and for preserving the brain plasticity.That is why the brain of an infant or child is more active during some stages of sleep than during wakefulness and awake activities.  The importance of sleep and sleep cycles for the fetus in utero and the preterm infant in intensive care unit is known for more than 40 years.  REM sleep deprivation in kids might result in disordered sensory system, disordered learning and memory, disordered or disrupted learning and memory creation, loss of cortical plasticity into adult life and also smaller adult brain size. The deprivation of Non REM sleep might result in decreased learning and memory consolidation from sensory experiences, less ability to learn in childhood and adult life and loss of brain plasticity into adult life. 
The main question for me is how my behavior is actually affecting the sleep of the fetus? It seems that when I am more active, the kid can more happily sleep and when I am resting, it starts to wake up. . In  Kintraia et.al explored the daily rhythmicity of 2500 fetuses using the electrotachogram and they found out that “daily rhythmicity of fetal electrocardiogram resembles that of the mother; however, the phase of the rhythm is opposite to that of the mother. “Active” (from 9 a.m. to 2 p.m. and from 7 p.m. to 4 a.m.) and “quiet” (from 4 a.m. to 9 a.m. and from 2 p.m. to 7 p.m.) periods of activity were identified.” A baby may be more active about an hour after the mother eats. This is because of the increase in sugar (glucose) in the mother’s blood. Fetal movement normally increases during the day with peak activity late at night.”
Anyway, there is evidence that the mother activity might directly affect the fetus behavior “ultrasounds have shown a fetus bouncing up and down when the mother laughs.”  Also mother movements and activity actually might make it more pleasant for the kid to sleep then when she is in a calm position. What is interesting is that the baby’s brain won’t produce melatonin till the age of 3 months to develop its own circadian clocks. So in the womb it relies on signals from your body clock as melatonin can cross the placenta and after birth, some amount of melatonin can still be passed to the baby through breastmilk. Until circadian clock develops, newborn sleep patterns will be fairly irregular.  It is also interesting to see the research of the fetus activity based on the mother sleep position. In  they explored 36 pregnant women and found out that when the mother slept on her back, the fetus was less active. As the fetal activity is one measure of its well-being, it is suggested for women to sleep on their side during the later pregnancy (after 28 weeks) to reduce the risk of stillbirth.
You maybe would like to predict the sleep pattern of the newborn and other infant behavior from the fetus movements. Unfortunately, based on the DiPietro study on 52 healthy fetuses, there is no evidence for such predictions [14, 15],
How mothers sleep deprivation affects the fetus?
It might not be only due to the fact that you have a lot to do in the evening why you cannot have a really long night of well-quality sleep. I have to say that in this sense I was quite lucky as I sleep typically quite well. Maybe due to the fact that I typically go to bed later than I should, I have no problems to fall asleep directly and if I do not drink a liter of water before sleep, I can survive without toilet sometimes even till the alarm or kids wake me up. So my main problem is to find enough hours for sleep. Many women however have other reasons for sleep deprivation – insomnia, restless legs syndrome, frequent nighttime urination, etc.[16, 17] My concern is now about my night papers deadlines, when I do not get enough sleep, what then happens to the baby?
“Sleep deprivation during pregnancy has been associated with longer labor, elevated perception of pain and discomfort during labor, higher cesarean rates, preterm labor, and higher levels of pro-inflammatory serum cytokines. Limited research has also indicated a possible relationship between sleep deprivation and preterm births and postpartum depressive mood.”  However the studies are typically done on poorly controlled studies and non-representative samples. Study on more than 1000 women showed that Women with severe snoring were at high risk for low birth weight, and fetal-growth-restricted neonates and women with sleep deprivation (≤5 hours sleep) were at high risk for preterm births, with the highest risk observed for medically indicated preterm births [19,20].
The most interesting topic for me is if the mother sleep deprivation might actually also affect emotional and cognitive development of the baby. One of the effects on the cognitive development of the newborn might be the fact that the sleep deprivation during pregnancy increases the risk of postpartum depression, which in consequence increases the risk that the mother-child bonding is not created properly which in consequence can affect the kids emotional and cognitive development. Corresponding to the more direct effects on the cognitive development of the child, it is very challenging to perform the real experiment on humans as it is not really ethical to sleep deprive women and create meaningful controlled studies.
At least, there have been done several interesting studies using rats. In  they sleep deprived pregnant rats and then investigated the offsprings and found impaired hippocampal-dependent spatial learning and memory, and increased depressive- and anxiety-like behaviors. In  they observed “increased brain derived neurotrophic factor (BDNF) in the hippocampus of fetuses of sleep deprived mother rats, which indicates that sleep restriction of mothers during the final week of gestation (last trimester of rats pregnancy) may affect neuronal growth factors in a fetal brain structure, in which active neurogenesis occurs during the deprivation period. However, no changes in the total reactive oxygen species (ROS) in the cortex, hippocampus, or cerebellum of the fetuses were detected.” In  they found out that sleep deprivation during late pregnancy can produce hyperactivity and increased risk-taking behavior in rat offspring.
-  Sleep and mortality: a population-based 22-year follow-up study. Hublin C, Partinen M, Koskenvuo M, Kaprio J Sleep. 2007 Oct; 30(10):1245-53.
- Measuring fetal brain activity:
-  Fetal EEG – from scalp during surgical termination of pregnancy, from mother abdomen, scalp during labor https://en.wikipedia.org/wiki/Fetal_EEG
-  Fetal fMRI https://ehp.niehs.nih.gov/doi/10.1289/EHP2268https://www.nibib.nih.gov/news-events/newsroom/new-technology-reveals-fetal-brain-activity
- Fetus sleep:
- : https://www.sciencedaily.com/releases/2009/04/090413185734.htmhttps://www.psychologytoday.com/us/articles/199809/fetal-psychology
-  The article “Nonlinear analysis and modeling of cortical activation and deactivation patterns in the immature fetal electrocorticogram,” by K. Schwab et al was published March 31, 2009. [Chaos 19, 015111 (2009)]. The article is available at https://aip.scitation.org/doi/10.1063/1.3100546. Journalists can obtain a copy of the article by emailing
-  Sleep and Brain Development: The Critical Role of Sleep in Fetal and Early Neonatal Brain Developmenthttps://www.sciencedirect.com/science/article/pii/S1527336908001323
-  Sleep and brain development Graven https://pdfs.semanticscholar.org/e8de/0bf57365b7b95e2dff715345b3839133f9e4.pdf
-  Development of daily rhythmicity in heart rate and locomotor activity in the human fetus https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1079927/
-  https://www.stanfordchildrens.org/en/topic/default?id=fetal-movement-counting-90-P02449
-  https://www.babycentre.co.uk/x25015783/can-i-predict-my-babys-sleeping-routine-from-her-movement-in-the-womb
-  Peter R. Stone, Wendy Burgess, Jordan McIntyre, Alistair J. Gunn, Christopher A. Lear, Laura Bennet, Edwin A Mitchell, John M. D. Thompson. An investigation of fetal behavioural states during maternal sleep in healthy late gestation pregnancy: an observational study. The Journal of Physiology, 2017; DOI: 10.1113/JP275084
- : What does fetal movement predict about behavior during the first two years of life? Janet A. DiPietro,Marc H. Bornstein,Kathleen A. Costigan,Eva K. Pressman,Chun‐Shin Hahn,Kathleen Painter,Barbara A. Smith,Linda J. Yihttps://onlinelibrary.wiley.com/doi/abs/10.1002/dev.10025
- : Encyclopedia of Human Development, Volume 2: edited by Neil J. Salkind, Lewis H. Margolis, Kimberly DeRuyck, Kristin Rasmussen
- Mother sleep
-  https://www.sleepfoundation.org/articles/pregnancy-and-sleep
-  https://familydoctor.org/getting-enough-sleep-pregnancy/
-  Sleep Deprivation during Pregnancy and Maternal and Fetal Outcomes: Is There a Relationship? https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2824023/
-  Micheli K, Komninos I, Bagkeris E, et al. Sleep patterns in late pregnancy and risk of preterm birth and fetal growth restriction. Epidemiology. 2011;22(5):738-44.
-  Insomnia and sleep deficiency in pregnancy https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4935047/pdf/10.1177_1753495X15600572.pdf
-  Maternal sleep deprivation at different stages of pregnancy impairs the emotional and cognitive functions, and suppresses hippocampal long-term potentiation in the offspring rats https://molecularbrain.biomedcentral.com/articles/10.1186/s13041-016-0197-3
-  Effects of sleep restriction during pregnancy on the mother and fetuses in rats https://www.sciencedirect.com/science/article/pii/S0031938415301967#bb0075
-  Sleep deprivation during late pregnancy produces hyperactivity and increased risk-taking behavior in offspring https://www.sciencedirect.com/science/article/abs/pii/S0006899314015686