yapern

Create a message

B I S x2 H “” </> •••

0/2000

Create new sub-yap

← Blog

Should you make your own REM Sleep Patch?

· Andrew Arrow

A patch that gets you into REM sleep 43 minutes sooner, with another 16 minutes of REM once you’re there, is a pretty good pitch. Those are the numbers in today’s ScienceDaily story about NEUSLeeP, developed by researchers led by UT Austin. Then comes the detail that makes a programmer’s shopping finger twitch: the researchers published their code.

There’s MATLAB, Python, an Arduino, and enough device information to start asking practical questions. How much of this can you reproduce? Could you build the sleep monitor first? Is the ultrasound part an unusually ambitious weekend project?

I’d happily start with the analysis software. I’d want an acoustics lab involved before building the ultrasound hardware, and I wouldn’t make a homemade version to wear to bed. Reading the paper and the code gives some specific reasons for that judgment, including a complication that matters even if somebody hands you a perfectly manufactured patch.

The second night was always the stimulation night

The Nature Communications paper, also indexed on PubMed, describes 28 overnight-study participants. Two recordings were excluded for extensive noise, leaving 26 people in the sleep analysis. Average REM share rose from 16.3% to 20.9% of sleep, a gain of 4.6 percentage points. That’s different from a 4.6% relative increase. The authors report about 15.9 additional REM minutes.

REM latency means time from falling asleep to the first REM episode. It fell from about 177 to 135 minutes. It doesn’t mean participants fell asleep 43 minutes faster. The figure below shows the reported pooled means, without individual responses or uncertainty intervals. It also preserves a consequential detail of the comparison.

Reported means for 26 usable paired recordings: REM sleep share was 16.3% on sham night and 20.9% on stimulation night. REM latency was 177 and 134.7 minutes. Sham was always night one; stimulation was always night two. The charts show group averages, without individual responses or uncertainty intervals.

Everyone had sham first and ultrasound second. The trial registry confirms the nonrandomized order. Its enrollment of 52 covers several study phases; it isn’t the sample size of this overnight comparison. The registry also excludes diagnosed sleep disorders, so don’t read the paper’s “insomnia” group label as a trial treating diagnosed chronic insomnia.

With that order, getting accustomed to the room and equipment could contribute to a better second night. Having each person serve as their own control helps with differences between people, but it doesn’t separate stimulation from being there for a second night. The authors acknowledge order and expectancy effects. Their concern was that stimulation might persist and contaminate a later sham night.

That’s a reasonable problem to confront, and an unresolved one. A small study can justify a better experiment without establishing that the patch caused the entire improvement. It certainly doesn’t establish that maximizing a nightly REM number will make you healthier.

The patch still has cables

UT’s announcement shows a soft patch with wires coming out of it. Keep those wires in the mental picture. Wearable describes what sits against the skin; the repository’s equipment list includes a Verasonics Vantage 64LE ultrasound system, an EEG amplifier, an oscilloscope, a motorized three-axis system, and MRI equipment.

NEUSLeeP combines electrical recording with an eight-channel concentric ultrasound array aimed at the subthalamic nucleus, a deep brain structure involved in wider sleep-related circuits. EEG records scalp electrical activity; EOG records eye movements; EMG records muscle activity. Those are measurements. The ultrasound array supplies the intervention. Combining them on a flexible substrate doesn’t remove the separate problems of acquiring a clean signal and delivering a known acoustic field.

The rings are worth looking at. They share a center, but sound from the outer rings has farther to travel to a point on the axis. Relative timing lets their waves reinforce one another at a chosen depth. This original drawing follows the ring geometry in the authors’ simulation code; the paths are schematic, in water, and don’t show a measured beam or a human targeting plan.

Front view of eight separate concentric transducer rings, beside a section through their center. Representative paths from outer rings to an axial focus are longer than paths from inner rings. Relative channel timing compensates for those distances in a simplified water model. The drawing is not a measured acoustic field.

An Arduino appearing in the repository can make this feel familiar. But the README assigns ultrasound control to the Verasonics system. A timing controller doesn’t replace the multichannel equipment driving the transducer. Pricing an Arduino and some electrodes would miss most of the difficult project.

A useful first project is already in the repository

Start with NEUSLeeP/Simulations/BeamProfileSkull.m. It uses k-Wave, an acoustic simulation toolbox, to compare propagation in a uniform medium with propagation through modeled skull layers. The script varies skull curvature and computes the location and width of the resulting focus. That gives you something more useful to investigate than whether you can make a piezoelectric element vibrate.

The file explicitly implements a two-dimensional approximation of the ring array. That makes it a useful model to study and a poor substitute for an individualized three-dimensional head model. Reproducing a plot means you reproduced that calculation under its assumptions.

There’s a similarly instructive dependency in the thermal script. Before estimating temperature, it loads a pressure field:

%% Load Pressure Field
load('Free-Field -f170.mat');
[Nr, Ny] = size(p_measured);

The pressure field is an input. A convincing temperature plot still depends on the right measurement, units, material assumptions, and exposure history. Changing the transducer or its coupling to the surface means you have to establish those inputs again. Copying a script doesn’t copy the calibration.

The documented environment includes MATLAB 2024b, COMSOL 6.0, Python, and EEG and imaging tools. That’s a list for the research project, not a requirement to install everything before reading one script. For this starting point, identify the k-Wave dependency and the particular inputs first. I’ve inspected the source here; I haven’t run the authors’ MATLAB simulations or independently reproduced their experimental results.

The skull is part of the apparatus

A working electrical waveform establishes what came out of the driver. An acoustic measurement establishes what the transducer delivered into a particular medium. Neither, by itself, establishes what reaches a particular person’s brain.

The ITRUSST safety consensus explains why the difference matters. Bone absorbs ultrasound, so thermal assessment must consider the skull and adjacent tissue as well as the intended focus. Skull geometry also changes the transmitted field. The consortium calls for validated models or measurements that account for variation between people; measuring one skull cannot capture that variation.

That makes a water tank or phantom a worthwhile destination for a hardware project, provided you have suitable equipment and expertise. A calibrated hydrophone, essentially a microphone for pressure in water, lets you compare the acoustic field with the model. A beam measured there is a bench result. Human use adds anatomical targeting, acoustic and thermal assessment, screening, monitoring, and ethics review. The consensus explicitly says its risk guidance cannot replace ethical evaluation.

I wouldn’t turn the paper’s stimulation settings into a home recipe. The missing information is what a different device would deliver through your anatomy, and whether changing your sleep that way is beneficial. A successful compile answers neither question.

The version I’d build first

I’d start with an offline sleep-analysis tool and an existing scored overnight recording. Read the signals, produce a sleep-stage timeline, compare it with the reference labels, and inspect where the classifications disagree. You can learn a lot before buying hardware.

YASA provides automatic staging from EEG, with optional eye and muscle channels, plus probabilities for each stage. Its documentation recommends review by a trained scorer, especially for low-confidence epochs and recordings from unusual sensor arrangements. A homemade monitor needs that comparison before its REM totals deserve much trust.

There’s a particularly easy software trap here. YASA’s standard staging features include a centered 7.5-minute rolling window, which uses future samples. That’s fine when analyzing last night’s recording. An unmodified offline classifier therefore cannot simply become an instantaneous controller. A live implementation would need different handling and its own validation. Streaming the samples doesn’t make the algorithm causal.

If recording hardware becomes useful, BrainFlow supports acquisition from boards such as the OpenBCI Cyton, along with synthetic and playback sources for developing the software. That would be a separate sensing project; it wouldn’t reproduce NEUSLeeP’s materials or validate its ultrasound effects.

ProjectA useful finish line
Offline sleep analysisCompare predicted stages with a scored recording and inspect the errors.
Acoustic simulationReproduce a field calculation and explain how its assumptions affect it.
Ultrasound bench prototypeMeasure the field in water or a phantom and reconcile it with the model, with lab support.
Human sleep interventionEstablish safety and benefit through appropriately reviewed, controlled research.

For the hardware, I’d contact the researchers before ordering custom parts. The README lists Kevin Tang and the corresponding investigators. Ask which fabrication files and calibration datasets match the published device, what requires custom manufacture, and whether there’s a research collaboration or sample available. Those answers would tell you more about feasibility than a speculative shopping list.

NEUSLeeP is worth taking seriously because its authors made enough public to inspect and question. The fixed night order gives the next sleep study a problem to solve; the simulation code gives an engineer a concrete place to start. I’d take that invitation. But if the goal is better sleep tonight, building a brain-directed ultrasound device means taking on a research program before you know whether the intervention helps. Start with the recording you can check.

Contact the NEUSLeeP team

The project README publishes these research contacts:

Kai Wing “Kevin” Tang, first author
kevin.tang@utexas.edu

Huiliang “Evan” Wang, principal investigator and corresponding author
evanwang@utexas.edu

Gregory A. Fonzo, corresponding author
gfonzo@austin.utexas.edu

Vincent Mysliwiec, corresponding author
mysliwiec@uthscsa.edu