When we dream, something mysterious happens within our brains – we experience something similar to being awake, and yet also very different to being awake, and scientists are still trying to unpick exactly what's going on in that in-between state.

Now another clue has been discovered. A new study has found that one crucial feature of consciousness – the ability to be aware of sounds or to identify them – actually gets switched off while we're asleep, and it could help us figure out how our brains dream.

Mapping the brains of living people while both awake and asleep isn't easy – few of us would want electrodes implanted in our skulls during our day-to-day activities – but here the team took advantage of medical research being carried out on epilepsy patients.

"We were able to utilize a special medical procedure in which electrodes were implanted in the brains of epilepsy patients, monitoring activity in different parts of their brain for purposes of diagnosis and treatment," says neuroscientist Yuval Nir, from Tel Aviv University in Israel.

"The patients volunteered to help examine the brain's response to auditory stimulation in wakefulness versus sleep."

The electrodes enabled the researchers to see the differences in the response of the cerebral cortex when patients were in different stages of sleep compared to when they were awake – right down to individual neurons.

For the purposes of the study, the researchers played a variety of sounds through speakers at the bedsides of the volunteers. Data on over 700 neurons (about 50 per patient) were collected across the course of eight years.

While the brain's response to sound remained largely switched on during sleep, there was a rise in the level of alpha-beta waves – waves associated with attention and expectation. It seems incoming sounds are being analyzed, but not passed to the consciousness.

This goes against previous thinking: that during sleep, sound-related signals quickly decay in the brain. In fact, they stay stronger and richer than we thought, it's just that there's one significant difference in the way they're processed while we're snoozing.

"The strength of brain response during sleep was similar to the response observed during wakefulness, in all but one specific feature, where a dramatic difference was recorded: the level of activity of alpha-beta waves," says first author, neuroscientist Hanna Hayat, from Tel Aviv University.

These alpha-beta waves (10-30Hz) are controlled by feedback from higher up in the brain – this feedback (including whether or not sounds are new) helps our minds work out which sounds are important and need to be listened to.

A similar sort of upward shift in alpha-beta wave patterns has previously been observed in patients under anesthetic, but it hasn't been seen in people sleeping. The researchers describe it as one way of grasping the "fascinating enigma" of how the conscious brain differs from the unconscious brain.

This also gives scientists a quantitative and reliable method of measuring if someone really is unconscious or not: during hospital operations, in comatose individuals, when checking for signs of dementia, and so on.

"Our findings have wide implications beyond this specific experiment," says Nir. "In future research we intend to further explore the mechanisms responsible for this difference."

The research has been published in Nature Neuroscience.