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. 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. 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.
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.
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. Bring your own pillow.
Người ta ra biển để nghỉ, có lý do cả. Sóng biển to, đo tuyệt đối là to thật, vậy mà nhiều người nghe lại thấy êm. Một phần nghịch lý nằm ở thống kê: sóng tự nhiên xấp xỉ pink noise, còn gọi là noise 1/f vì công suất giảm đều đặn khi tần số tăng. Pink noise mang năng lượng bằng nhau trên mỗi octave. Tiếng ù trầm có trọng lượng mà không gắt kiểu white noise, nơi dải tần nào cũng nhận công suất y hệt nhau. Estua tổng hợp kết cấu thống kê đó theo real-time thay vì phát lại một bản ghi 8 phút mà não bạn sẽ bắt bài ở phút thứ ba.
Nói trước cho rõ: bọn mình là studio làm app chứ không phải phòng khám giấc ngủ. Không chạy thử nghiệm EEG, không đưa claim y khoa nào. Mình đọc tài liệu psychoacoustics, tự nghe bản nightly mỗi đêm và ship audio né được mấy cái bẫy cảm nhận mà app dùng loop hay dính. Bài này nói vì sao phổ kiểu sóng biển giúp vào giấc và Estua dựng nó không để lộ mối nối ra sao.
Pink noise thật ra là gì
White noise nghe như nhiễu tivi chưa dò kênh. Dải nào cũng góp công suất như nhau, nghe vài phút là tai thấy chói và mỏi. Pink noise cắt dần tần cao với dốc −3 dB mỗi octave, mật độ công suất theo S(f) ∝ 1/f. Dốc này có tính chất gọn: tích phân 1/f trên bất kỳ octave nào, từ f tới 2f, đều ra ln 2. Octave nằm đâu không quan trọng — dải 100–200 Hz chứa đúng bằng năng lượng dải 4–8 kHz. Ốc tai xếp tần số gần như theo thang log, nên năng lượng đều mỗi octave nghe ra cân bằng. Brown noise dốc −6 dB mỗi octave, nghe bí, như đứng trong phòng khách sạn nghe biển qua tường.
Sóng thật gần pink chứ không trùng khớp. Mùa xuân rồi mình ghi 20 phút sóng ở Vũng Tàu, một máy, mic gốc, cầm ngang ngực. Dốc fit được giữa 100 Hz và 2 kHz ra khoảng −3,2 dB mỗi octave. Cưỡi trên dốc đó là transient: một đợt swash to hơn, một cơn gió táp vào cửa. Chúng không cách đều nhau. Chính độ ngẫu nhiên thô đó giữ soundscape sống; cũng chính phần đó bị loop đóng băng.
Cái bẫy autocorrelation
Thính giác người cực nhạy với thứ lặp theo chu kỳ. Đại lượng đo chuyện này là autocorrelation, R(τ) = E[x(t)·x(t+τ)]: tín hiệu giống bản trễ của chính nó tới đâu. Phát một loop ghi âm thì R(τ) vọt đỉnh tại đúng chu kỳ loop. Crossfade khéo mấy cũng chỉ giấu được tiếng click, không giấu được cái đỉnh. Tai vẫn tìm ra. Tiến hóa thưởng cho việc bắt pattern lặp trong tiếng cỏ xào xạc, vì lặp đôi khi nghĩa là thú săn mồi đang lượn quanh. Cơ chế gì đi nữa thì hiệu ứng cũng dễ tự kiểm chứng: nghe loop biển tới phút thứ ba, một phần chú ý của bạn đã ngồi đợi con sóng quen mặt.
Bọn mình đo hẳn hoi trên bàn bench. Hai máy ghi hai phiên 64 phút, một máy phát app ngủ dùng loop khá nổi tiếng, máy kia phát scene biển của Estua, xong phân tích offline. Loop cho đỉnh autocorrelation chuẩn hóa cỡ 0,6 tại lag 8 phút. Estua nằm dưới 0,08 ở mọi lag quá 30 s, tức là chạm sàn nhiễu của chính phép ước lượng. Synthesis làm được vậy nhờ trôi quan hệ pha liên tục: các LFO không tương quan điều biến cutoff và gain của filter, scene không bao giờ quay lại một cấu hình đã phát.
Giải phẫu một scene biển
Scene biển của Estua gồm ba đường noise cộng các tín hiệu điều khiển chậm. Nền là dải thấp 80–400 Hz, điều biến biên độ ở 0,05–0,12 Hz. Đổi ra chu kỳ là một con sóng mỗi 8–20 s, ôm trọn chu kỳ 8–14 s của sóng lừng ngoài biển thật. Dải giữa 1–4 kHz cho tiếng hiss của bọt, lọc về pink, điều biến nhẹ để thở cùng nhịp sóng. Dải cao tùy chọn thêm chút lấp lánh dưới 8 kHz, ghìm thấp hơn full scale ít nhất 30 dB. Ở mức đó nó gợi không khí. To hơn là thành kim châm.
Mưa cần chiêu khác, vì cụm giọt không rơi theo metronome. Estua kích các burst noise band-pass theo nhịp Poisson, khoảng chờ rút từ phân phối mũ:
// chạy ở control rate, mỗi block một lần
gap = -ln(rand01()) / rate // khoảng chờ phân phối mũ
f0 = jitter(1.5 kHz, ±0.5 oct) // tâm dải đổi theo từng burst
burst = bandpass(noise, f0, Q=2)
env = attack 2–8 ms, decay 40–120 ms
play(burst * env, at = now + gap)
// rate cũng trôi 0,5–3 burst/s theo một LFO chậm
Mỗi lần mở scene, app rút một seed; mỗi seed khởi tạo bộ sinh ngẫu nhiên độc lập cho từng đường. Hai đêm cùng tên scene vẫn khác nhau trong chi tiết, trừ khi bạn cố ý dùng lại seed ưng ý — lúc đó cùng một diễn tiến chạy lại từ cùng điểm xuất phát. Vài người ghim một seed; đa số để xúc xắc tự gieo.
Giữ real-time ở 48 kHz
Toàn bộ chạy trên audio thread ở 48 kHz, block 512 sample. Cỡ block đó là deadline cứng: 512 sample ở 48 kHz cho 10,67 ms để dựng xong mỗi buffer, trễ một lần là nghe glitch lúc 2 giờ sáng. Hot path không allocate, không lấy lock, đọc tham số qua cấu trúc lock-free; luật đầy đủ nằm ở sống trên audio thread. Bản thân chuỗi synthesis — filter pink tiết kiệm của Paul Kellet, chỗ đặt limiter, engine audio từng nền tảng iOS và Android — có trong âm thanh không bao giờ lặp. Cả scene tốn cỡ 3–8% CPU trên máy đời mới, còn dư sức cho Bluetooth và mấy pha app nền suýt bị suspend.
Chuyện riêng tư giống mọi app uranashel. Âm thanh sinh ngay trên máy, không tài khoản, thói quen nghe của bạn không rời khỏi điện thoại. Lý do đầy đủ ở vì sao mọi thứ chạy trên điện thoại.
Audio ngủ nên to cỡ nào
Độ to nên đo chứ đừng đoán. Bọn mình log mức âm tầm gối bằng Sonarish chạy trên máy thứ hai, bảy đêm, hai phòng ngủ. Cài đặt Estua thường gặp rơi vào 42–55 dBA. Để so: định mức nghề nghiệp 8 giờ của NIOSH là 85 dBA; 55 dBA chỉ mang một phần nghìn năng lượng âm của mức đó. Chữ A trong dBA làm việc thật sự ở đây. Năng lượng sóng biển dồn vào dải thấp mà tai bỏ qua khi nghe nhỏ, nên meter không weighting sẽ thổi phồng tiếng ù thêm 10 dB hoặc hơn. Toán weighting nằm ở A-weighting và decibel.
Luật bọn mình chốt: tăng volume tới khi thứ cần che — xe cộ, máy nén tủ lạnh, tivi nhà hàng xóm — thôi lôi kéo chú ý, rồi dừng. Phổ pink đè lên hầu hết tiếng ồn trong nhà, nên che được ở mức nhỏ hơn nhiều người tưởng. Cần quá 60 dBA mới ngủ được thì thứ đang che đáng đem đi sửa tận gốc.
Chi tiết lúc 2 giờ sáng
Audio ngủ là bài toán không gian chung: người nằm cạnh đâu có chọn soundscape của bạn. Timer ngủ đặt được 20–45 phút, bắt đầu fade 20 phút trước khi tắt, 3 phút cuối hạ tổng cộng chừng 30 dB. Im lặng đến theo con dốc. Không ai giật mình vì âm thanh biến mất đột ngột — lỗi có thật của mấy app cứ thế ngắt cái phụp.
Báo thức dùng tone tổng hợp nhẹ từ một scene hoàn toàn khác, tiếng đã ru bạn ngủ không dính vào buổi sáng. Một âm vừa ru xuống vừa kéo dậy thì não sẽ gắn nó với cảm giác gấp gáp, phần ru mất tác dụng. Tách hai việc ra hai âm thì cả hai cùng chạy tốt.
Tự kiểm chứng
Mấy cái phổ ở trên không cần tin suông. Phyzix có generator và meter vẽ phổ white, pink, brown cạnh nhau, dốc −3 dB mỗi octave hiện ngay trên đồ thị live. Sonarish đứng đầu kia của bàn bench: nó đo. Ghi trọn một phiên rồi chạy autocorrelation offline là cách bọn mình xác nhận build Estua thật sự sạch đỉnh tuần hoàn trước khi ship; cũng chính phép phân tích đó sẽ lôi ra cái đỉnh 8 phút của bất kỳ app loop nào bạn chĩa vào.
Còn nếu bạn đến vì tiếng sóng, danh sách scene nằm ở trang Estua. Gối tự mang.