GreenNoise / SleepWave
A suite of three Android apps for relaxation and sleep. They synthesize green noise from first principles, rise and fall in volume with the user's breathing, and show biofeedback that helps the user settle into slow, calming breaths.
The problem
Noise apps play static recordings that ignore the listener. Slow paced breathing (about 0.1 Hz) is known to calm the nervous system, but it takes conscious effort, which defeats the purpose when you're trying to fall asleep.
What I built
Noise synthesized with a custom FFT that loops seamlessly, a smooth breathing-matched volume envelope, accelerometer breathing detection, and a two-circle synchrony display that guides breathing without effort.
The result
Three successive apps installed and validated on a phone in real conditions: an all-night transatlantic flight with noise-cancelling headphones, and overnight sleep.
Each version built on the last
GreenNoiseApp
Spectrally shaped green noise peaking at 600–800 Hz, synthesized in the frequency domain with random phase. Loops seamlessly and works with Bluetooth and noise-cancelling headphones.
green_enhanced
Adds a breathing-matched volume envelope with adjustable breath period (3–10 s), adjustable envelope shape, manual phase sync and automatic breathing-rate detection from the accelerometer.
SleepWave
Two-circle biofeedback (noise rhythm vs. detected breathing, with a glow when they line up), a live breathing-signal trace, redesigned filters, signal strength and an "IN SYNC" indicator.

Physics from end to end
For the engineers in the room
Signal processing decisions
- Chose a Kaiser-Bessel window as the volume envelope for its smoothness and its single shape parameter. At β = 10 the exhale is nearly silent (about 0.035% of peak), normalized to exactly [0, 1]
- Used smooth transitions to avoid the "orienting response" that sudden volume changes trigger in the brain
- Lined up the envelope phase with the detected breathing cycle so the display shows true synchrony
- Timed everything from the phone's monotonic clock, so clock corrections or time-zone changes during a flight can't cause drift
Where engineering judgment mattered
- Saw that the AI's first breathing filter had its cutoff at 0.08 Hz, below the whole breathing band. I redesigned it with time-adaptive coefficients, α = 1 − exp(−2π·fc·Δt)
- Diagnosed build-tool version mismatches, USB driver confusion (file-transfer vs. debugging driver) and three successive build errors through to a deployed app
Scientific basis
- A brainwave front end to close this feedback loop is in build: see Analog Front Ends & Signal Conditioning
- Slow breathing near 0.1 Hz maximizes heart-rate variability and calms the nervous system (research on respiratory sinus arrhythmia and HRV biofeedback)
- Rhythmic volume changes at breathing frequency encourage the breath to follow along; a visible synchrony target makes it effortless
Sensor-driven mobile apps
This project shows the full mobile path: DSP from first principles, phone sensors, real-time graphics, and deployment and field validation on a real device. It applies to:
- Wellness, sleep and biofeedback products
- Phone-based sensor telemetry and diagnostics
- Audio synthesis and real-time signal processing apps
Stack
Need signal processing on a phone?
From the math to an app running on the device.
Start a conversation