thanks to Daniel's livestream this month, I've restarted a project form a couple of years ago that I would welcome some feedback and comments on.
It's essentially a single channel EEG machine that will look for the signature of REM while you sleep.
At the moment I have some prototype hardware, and I'm just working on the software to implement an algorithm that detects REM by looking at the content of Alpha waves.
To start with I just want to keep it simple as a way of showing when your REM periods are, and not to worry about going to the next stages of trying to make a "dream machine", because I think getting that first step right is more important.
The obvious next stage would be at least to be able to set an alarm to allow efficient timing of a WBTB.
The main device will obviously have to be some sort of headband, but I'm toying with whether initially it should be stand-alone, or connected to a phone, and how the interface would look.
I'd be interested to hear what people think.
Hang on, I did reply, I remember now. I was saying something about the sensors on my chest strap heart rate monitors were removable as they used 2 poppers to attach so you could wash the straps. Also, they relied on sweat, or rather skin moisture to work and that you'd probably find contacts worked just with a headband adding that warmth as you don't need to be dripping in sweat for the HRM to work...although maybe that doesn't need to be as sensitive...I don't know! :)
Hey Dan, that's weird. Dreamstate on the home page shows you made a comment 19h ago, but it doesn't seem to be there?
I'd welcome some feedback about where I think this is headed.
I am thinking of a lightweight, small, single band headband with sense electrodes at the front. Initially it might have two channels, one for EEG, the other EOG (to detect eye movements), and probably the accelerometer.
First version might just record the data all-night and send it to a phone or PC for playback later, where people can view the data and try to spot the REM periods.
Later improvements would hopefully have the REM detection algorithm, and maybe eventually allow some cues to wake just before or during the REM period, maybe ultimately with tACS to actually nudge the wearer into an LD directly.
What do people think they need of such a device? Any other ideas?
Except he's not replied, so maybe I frightened him off with talk of lucid dreams!
Tried my latest modified headband last night. I've made it using "dry" silver-plated fabric electrodes, but although some of the recording is fine, there are periods where I think the electrical connection is not as good, so the data is bad. More testing needed!
I've just had a reply from the author of the paper I'm using as the basis of the REM detection algorithm - a prof from Imperial. Hopefully he won't turn up his nose at it since I've mentioned it's to do with lucid dreaming 😁 It would be great to initiate a bit of real science behind it.
Mate, it sounds great, especially for those of us that like that extra helping hand of assurance and a bit more knowledge when scrabbling about in the dark...sometimes literally!!
Thanks Dan. I'm slowly getting to understand a bit more about my own sleep stages at least. I'm getting a bit more disciplined when I do a whole night recording about noting when I have awakenings after a dream, so I'm starting to piece together what the REM periods look like on the EEG trace. It would be good to be able to create a low-cost EEG so it's more affordable for all. The hardware doesn't actually have to be that expensive in fact, particularly if the difficult bit of analysing and displaying is done in a phone app. I might look at that as a next stage.
It's looking really good mate, I like the solidity of the readings on the eye movements, can't wait to read when you've managed to reproduce the Hearne experiment from a dream!
Here's the left-right eye flicks (awake) after that period of REM at time minute 269:42 (269 minutes 42 seconds) consisting of six left-right flicks in quick succession.
and a period at 243 where I think it might be REM, with some REM flicks boxed;
Here's an example of the output from my REM detection device from a whole-night recording.
The top trace is the output from the accelerometer, so the flat parts are "still" and the peaks are during movement.
The second trace is the spectral edge frequency difference of the EEG trace.
In theory the peaks should be in REM, but I had a bug in the S/W which meant it was incorrect. The lower two traces are also EEG analysis (AP and RP).
Having looked at the raw data (which is over 100 MB of recording!) I think the time around 02:15, minute 240 - 265 after start, might have been a REM period. That coincides with an awakening after a dream. I've also taken to flicking my eyes left-right repeatedly like in Keith Hearn's experiment to mark on the raw data when I wake.
I've corrected the bug now, and added a new feature looking for rapid eye movements by detecting large deflection movements on the EEG. Just waiting for a delivery to modify the headband to make it more comfortable.
Thanks for that G Um. I haven't yet compared it to the sleep tracker video. I think I may have had the first REM detection based on this algorithm, and it was at about 4 hours, so that's encouraging! There does seem to be a 90 minute pattern, so looking promising. I'm not sure what to make of the accelerometer yet. Only done one night's recording with it so far. There's a lot of complexity in the graph, with quiet periods and periods of movement, but the suggested REM periods do at least line up with the quieter bits.
I hadn't opened this thread until now. Nice work and good luck. In regards to your last post, have you compared the results to Daniel's sleep tracker video which has typical REM times? I have some of the approximate times from the video:
REM begins: ~4h14m, ~5h44m, ~7h22m
REM ends: ~3h01m, ~4h44m, ~6h18m
(I haven't noted all of the REM timings on it yet)
The description of the little remote box accelerometer on the mask made me think of somnimask that I saw on Instagram. I don't know anything about them, but it may be interesting to look at.
added an accelerometer to the unit that sits as a tiny remote box on the headband. Lots of data to analyse now! I think there is a pattern emerging, and I'm able to record awakenings after a dream to mark when the unit might be telling me I'm in REM. I may publish some results to see what people think.
This is sort-of related to what I'm doing;
https://openbci.com/
So still been making a little progress. I've been experimenting with electrodes! It's quite an issue to get right. The traditional way is with proper EEG electrodes, but they are messy and fiddly to apply. I've been looking at dry electrodes, but they don't seem to have the same performance. The main issue is making something that is really comfortable to wear all night. I would like to experiment with the same idea that the Zeo sleep band used, which was a silvered cloth-type patch, but I'm not sure where to get that from or how to make it. For now I'm going to push on with a more traditional EEG electrode and a conductive gel adhesive, because I want to show I can reliably detect REM first. I'll worry about the electrodes and implementation later.
Lots of data recorded to search through from a couple of nights' sleep. I'm also now recording the full EEG trace data using the SMT-EEG from Olimex, as well as the other hardware trying to decipher the REM periods from the same analogue signal. It's quite a complicated picture, and I'm confused as to where my REM periods actually are.
I think I need to adjust the positions of the electrodes and try again. I' also trying to record heart rate and movement with my smart watch. I've not been very disciplined about synching it all together which doesn't help!
Again, all sounds (very technical to my poor brain) great, good luck getting the extended times recorded accurately!
Thanks Dan, yeah that's sort of what I ws imagining, the difference being my device would first be recording brain waves to work out when you're in REM, then do the tACS. It doesn't look like that device is aiming to do that.
A bit more progress on the "GILD" (Gild Induced LD :-)), been trying to get my head around fixed point maths and FFTs, but I think I just about have it now. Apart from some scaling issues I do seem to be able to record a 30s epoch and have it analyse with sensible output data. Next steps are to get it continuously recording, then I can try a real night-time recording!
This just popped into my Inbox, not sure if it’s relevant or of any interest to you? https://www.indiegogo.com/projects/platowork-brain-stimulator?utm_content=campaigns_one_column10_hero_image&utm_source=sailthru&utm_medium=email&utm_campaign=bck-05042020indemand&gs_variant=control#/
Sound brilliant Andy I’ll be a guinuie pig