Dreamento Dev Path

Chapter 3 — The Frequency-Domain View

The EEG frequency bands (delta through beta), how to read a spectrogram, and a Colab lab computing one across a full real night.

Chapter 3 — The Frequency-Domain View

Think of it like this: that squiggly EEG line is actually several instruments playing at the same time, mixed into one sound — like a whole band recorded through a single microphone, or a smoothie that's already been blended. You can't see the individual strawberry or banana pieces anymore, and you can't tell by ear alone how loud the bass is right now from the mixed track. A spectrogram is a tool (mathematically, a Fourier transform) that unmixes the recording back into its separate ingredients over time — like a lab test that tells you exactly what proportion of strawberry versus banana went into the smoothie, except here the "ingredients" are frequency bands and the result updates continuously.

The Five Instruments

Each band has its own speed, its own "instrument," and — tying straight back to Chapter 2 — its own relationship to a sleep stage:

Why This Matters for What's Next

This isn't just a nicer way to look at the same data. Chapter 4's classical machine-learning baseline is literally fed band-power numbers — how much delta, how much theta, and so on, per 30-second epoch — as its main ingredients. Computing a spectrogram is the "prep the ingredients" step before any classifier can start cooking. Everything in Part 2 builds directly on what you're about to compute in this chapter's lab.

Try It: Frequency Band Match

The next lesson is a game built around exactly these five bands — match each instrument to its waveform speed before the lab makes you do the real computation.

THE LAB

You'll compute a real spectrogram across a full night from the same recording used in Chapters 1 and 2, plot it directly above the expert's hypnogram, and watch delta glow brightest exactly where the label says N3.

Open In Colab

DONE WHEN

You can point at a spot on a spectrogram and guess the sleep stage before checking the hypnogram underneath it.

That's Part 1 complete. Part 2 turns this same idea — band power per epoch — into actual numbers a classifier can learn from.