Unfortunately, I don't have any way to say "this data is from REM" and "this data is from nREM." All I can do is attempt different manipulations of the data and try to find one that produces data that "looks right" - i.e. that flags REM segments roughly 90 minutes apart. I've tried to look over the data visually, but there's so much of it I get lost in it 
Here's the whole night from a couple of nights ago. The red line labelled "Buttons" counts how many times the button on the mask has been pressed. I press it whenever I wake up and occasionally if I can't get to sleep, so I generally figure that I need to ignore a few minutes of data any time the Button line jumps.
2014-11-09.png
Just looking at it, I can't make heads or tails out of it. The only obvious thing from the graph is when I roll over in my sleep.
I know it's picking me up well enough. The first thing I always do when I turn it on is a sort of "calibration" - it's meaningless to the software, but I like to see it on the graph. Here's a magnified view of the very start of the night:
calibration.jpg
You can see me looking straight ahead, then left, then straight, then right, then straight. The green line is the raw sensor data (this happens to be from my left eye, but I log data from both eyes), and the violet line is a moving average. I take 8 readings per second, and this moving average has a window of 9 (4 readings on either side of the data point in question). When I'm testing it while awake, the readings hold steady as long as I hold my eyes steady. However, while asleep, something odd happens:
periods.jpg
Those peaks are about 3.5 seconds apart. I can pull up almost any part of the graph on almost any night and find something similar. It's not always as "clean" as this section (sometimes the highs and lows vary considerably from peak to peak), but this wave is always there (and is usually in the neighbourhood of 4 seconds). I can only assume it has to do with my breathing, but I can't figure out how - it's not like I hold my breath for 20 seconds while doing my "calibration," and I do it with my head on my pillow.
The technique I alluded to in my initial post comes from this link and involves "calculating the mean value, then summing the absolute values of the differences of the individual readings and the mean," and then scanning those results for groups of values higher than a given threshold. Applying that algorithm to my data yields the following graph (sorry, I have no idea why DV is shrinking this image):
2014-11-09-variance-2.jpg
Obviously, that algorithm is nowhere near perfect, and it's possible my guesses are completely wrong; but I don't think I'm imagining that some of those groupings end about 90 minutes apart. Many other nights of data show similar patterns, so I think I'm getting legit data.
Here's the raw data for this night. I need to head to bed now, but on Monday I'll post some more data files.
|
|
Bookmarks