# Sleep, waves, and why your brain likes surf > Why surf-like 1/f noise soothes sleep, and how Estua mimics it with slow modulation instead of a beach recording on repeat. 2025-11-10 · 18 min read · estua, physics · by ntan (ntan) for uranashel Canonical HTML: https://uranashel.com/blog/estua-sleep-and-waves.html --- There is a reason people travel to the coast for rest. Surf is loud in absolute terms yet feels calming to many listeners, and part of that paradox comes from statistics. Natural surf approximates pink noise, sometimes called 1/f noise because its power falls predictably as frequency rises. Pink noise carries equal energy per octave — low rumble gets weight without the harsh uniformity of white noise, where every frequency band receives the same power. Estua synthesizes that statistical texture in real time instead of replaying an 8-minute recording that your brain will detect by minute three. A disclaimer before the details: we are an app studio, not a sleep clinic. We run no EEG trials and publish no medical claims. I read the psychoacoustics literature, dogfood the nightly builds, and ship audio that avoids the perceptual traps loop-based apps fall into. What follows is why surf-like spectra matter for sleep onset and how Estua builds them without seams. ## What pink noise actually is White noise sounds like static on an untuned television. Every band contributes equal power, and over minutes the ear reads that as bright and fatiguing. Pink noise rolls the highs off at −3 dB per octave, so power density follows `S(f) ∝ 1/f`. That slope has a tidy property. Integrate `1/f` across any octave, from `f` to `2f`, and the result is `ln 2` regardless of where the octave sits: the band from 100 to 200 Hz holds the same energy as the band from 4 to 8 kHz. The cochlea organizes frequency roughly logarithmically, so equal energy per octave lands as balanced. Brown noise slopes at −6 dB per octave and sounds muffled, like surf heard through a hotel wall. Real waves sit close to pink without being exact. Last spring I recorded 20 minutes of surf at Vũng Tàu, one phone at chest height, stock mic. The fitted slope between 100 Hz and 2 kHz came out near −3.2 dB per octave. Riding on that slope are transients: a louder swash, a gust against a window. They are not evenly spaced. That rough randomness keeps the soundscape alive, and it is precisely the part a loop freezes. ## The autocorrelation trap Human hearing is exquisitely sensitive to periodicity. The measure that makes this concrete is autocorrelation, `R(τ) = E[x(t)·x(t+τ)]`, which asks how much a signal resembles a delayed copy of itself. Play a recorded loop and `R(τ)` spikes at the loop period even when careful crossfades hide the audible click. Your ear finds the spike anyway. Evolution favored detecting repeating patterns in rustling grass because repetition sometimes meant a predator circling. Whatever the mechanism, the effect is easy to reproduce at home. By minute three of a looped ocean track, part of your attention is waiting for the wave it already knows. We put numbers on this at our own bench. Two phones captured 64-minute sessions, one playing a popular loop-based sleep app and one playing Estua's ocean scene, analyzed offline afterward. The loop shows a normalized autocorrelation peak around 0.6 at its 8-minute lag. Estua stays below 0.08 at every lag beyond 30 s, which is the noise floor of the estimate itself. Synthesis earns that by drifting phase relationships continuously: uncorrelated low-frequency oscillators modulate filter cutoffs and gains, so the scene never returns to a configuration it has already played. ## Anatomy of an ocean scene An Estua ocean scene is three noise paths plus slow control signals. The foundation is a low band between 80 and 400 Hz with amplitude modulation at 0.05–0.12 Hz. Convert those rates to periods and you get one swell every 8–20 s, which brackets the 8–14 s period of real ocean swell. A mid band between 1 and 4 kHz supplies the hiss of foam, filtered to pink and modulated gently so it breathes with the swell. An optional high band adds sparkle below 8 kHz, kept 30 dB or more under full scale. Kept that quiet it reads as air; pushed much louder it starts to sting. Rain needs a different trick, because drop clusters do not fall on a metronome. Estua triggers band-passed noise bursts with Poisson timing, drawing each wait from an exponential distribution: ``` // runs at control rate, once per block gap = -ln(rand01()) / rate // exponential inter-arrival f0 = jitter(1.5 kHz, ±0.5 oct) // per-burst center burst = bandpass(noise, f0, Q=2) env = attack 2–8 ms, decay 40–120 ms play(burst * env, at = now + gap) // rate itself drifts 0.5–3 bursts/s under a slow LFO ``` Every scene start draws a seed, and each seed initializes independent random generators for every path. Two nights with the same scene name still diverge in detail unless you deliberately reuse a seed you liked, in which case the same evolution replays from the same starting point. A few users pin one; most let the dice roll. ## Staying real time at 48 kHz All of this runs on the audio thread at 48 kHz in 512-sample blocks. That block size is a hard deadline: 512 samples at 48 kHz gives 10.67 ms to produce each buffer, and one missed deadline is an audible glitch at 2 AM. The hot path allocates nothing, takes no locks, and reads parameters from lock-free structures; the full rulebook is in [life on the audio thread](https://uranashel.com/blog/dsp-audio-thread.html). The synthesis chain itself, from Paul Kellet's economical pink filter to limiter placement and the platform engines on iOS and Android, is documented in [sound that never repeats](https://uranashel.com/blog/estua-non-repeating-audio.html). A whole scene costs roughly 3–8% CPU on a modern phone, leaving headroom for Bluetooth output and the occasional background-suspension scare. The privacy posture matches every uranashel app. Sound is generated on the device, there are no accounts, and nothing about your listening habits leaves the phone. The reasoning lives in [why everything runs on your phone](https://uranashel.com/blog/on-device-first.html). ## How loud should sleep audio be Loudness deserves a measurement. We logged pillow-distance levels with Sonarish running on a second phone for seven nights across two bedrooms. Typical Estua settings landed between 42 and 55 dBA. For scale, the NIOSH 8-hour occupational limit is 85 dBA; 55 dBA carries a thousandth of that acoustic energy. The A in dBA does real work here. Surf energy concentrates in low bands the ear discounts at quiet levels, so an unweighted meter would overstate the rumble by 10 dB or more. The weighting math is in [A-weighting and decibels](https://uranashel.com/blog/a-weighting-decibels.html). The rule we settled on: raise the volume until whatever you are masking, traffic or a fridge compressor or a neighbor's television, stops drawing attention, then stop. Pink spectra overlap most domestic noise, so masking works at lower levels than people expect. If you need more than 60 dBA to sleep, the thing you are masking is worth fixing at the source. ## Details that matter at 2 AM Sleep audio is a shared-environment problem, because the person beside you did not choose your soundscape. The sleep timer runs 20–45 minutes and begins fading volume 20 minutes before off, with the final 3 minutes ramping down roughly 30 dB in total. Silence arrives as a slope. Nobody gets startled awake by the sudden absence of sound, which is a real failure mode of apps that simply stop. The wake alarm uses a gentle synthesized tone from a completely different scene, and the noise you slept to stays out of the morning. If one sound both lulls you down and yanks you up, the brain starts tagging it with urgency, and the lulling stops working. Keeping the two jobs on separate sounds keeps both working. ## Checking the claims yourself None of the spectra above needs to be taken on faith. Phyzix ships noise generators and meters that draw white, pink, and brown spectra side by side, so the −3 dB per octave slope becomes something you can see on a live graph. Sonarish sits at the other end of the bench: it measures. Recording a full session and running autocorrelation offline is how we verify that an Estua build truly lacks periodic peaks before it ships, and the same analysis will expose the 8-minute spike in any loop-based app you point it at. And if the surf itself is what you came for, the scene list is on the [Estua page](https://uranashel.com/apps/estua.html). Bring your own pillow. --- uranashel · [Home](https://uranashel.com/) · [Apps](https://uranashel.com/apps.html) · [Lab](https://uranashel.com/lab.html) · [About](https://uranashel.com/about.html) · [Blog](https://uranashel.com/blog/) · [Developers](https://uranashel.com/developers/) · [API docs](https://uranashel.com/docs/) · [Privacy](https://uranashel.com/privacy.html) Machine-readable: [llms.txt](https://uranashel.com/llms.txt) · [sitemap.xml](https://uranashel.com/sitemap.xml) · [openapi.json](https://uranashel.com/openapi.json) · [API](https://uranashel.com/api/v1/)