We are quite literally having our brains washed every night. Neuroscientists have now produced a fascinating video that shows this nocturnal pulsing process in action.

Waves of watery cerebrospinal fluid (CSF) flow over our brains, this latest study shows, pulsing rhythmically while we're snoozing, and at the same time clearing out any toxins that shouldn't be building up inside our heads.

The team behind these new insights says that the findings could help in the study of various neurological and psychological disorders, especially those associated with disrupted sleep patterns.

"We've known for a while that there are these electrical waves of activity in the neurons," says neuroscientist Laura Lewis from Boston University. "But before now, we didn't realise that there are actually waves in the CSF, too."

Previous studies have suggested that CSF is important for waste removal in the brain, but until now scientists hadn't known about this pulsing action, or been able to observe it.

In combination with the slow wave brain activity (which is partly for fixing our memories in place) and the decrease in blood flow that happens while we sleep, these CSF waves look to be washing out unnecessary proteins and other redundant debris.

As slow brain wave frequency drops as we get older, the new study could help with research into normal age-related problems, along with specific disorders.

The scientists' work also means that it's now possible to tell if someone is sleeping or not, just by analysing the CSF patterns on a brain scan.

"It's such a dramatic effect," says Lewis. "[CSF pulsing] was something we didn't know happened at all, and now we can just glance at one brain region and immediately have a readout of the brain state someone's in."

For the purposes of the study, 13 subjects aged between 23 and 33 were monitored while sleeping during an MRI scan. Future research could look at older subjects too – again to try and spot deterioration in the process as we get older.

Another improvement for follow-up studies, the researchers suggest, could be finding ways to eliminate the MRI scan: the noise it makes isn't terribly conducive to sleep.

One remaining question is how exactly CSF, brain waves and blood flow are getting into sync so effectively. It could be that as neurons shut down for the night, they don't need as much blood – and as the blood drains out, pressure in the brain is maintained by the influx of CSF.

"That's just one possibility," says Lewis. "What are the causal links? Is one of these processes causing the others? Or is there some hidden force that is driving all of them?"

The research has been published in Science.