Skip to content
Maximilian Vogt
← All notes
1 min read

Devlog #0: Why I'm building an EEG sleep band

Placeholder. This post shows the format of a note: text, a figure with a caption, math, and a code block. Replace it with your own first devlog entry.

Why this project

TODO: two or three paragraphs. What got you interested in sleep and closed-loop stimulation, what is missing in the devices that exist, and why you are building it yourself.

What comes first

TODO: why the software comes before the hardware, and what “done” means for the first phase.

A schematic, irregular wave of roughly one cycle per second over three seconds, crossing a dashed zero line.
Fig. 1. Placeholder: a schematic slow oscillation. Replace with your own plot.

A formula, to show the math support

The slow-oscillation band is usually taken as roughly 0.50.5 to 1.5 Hz1.5\,\text{Hz}. The instantaneous phase of a band-passed signal x(t)x(t) is often defined through its analytic signal:

ϕ(t)=arg⁡(x(t)+i H[x](t)),\phi(t) = \arg\big(x(t) + i\,\mathcal{H}[x](t)\big),

where H\mathcal{H} is the Hilbert transform.

A code block, to show syntax highlighting

import numpy as np
from scipy.signal import butter, sosfiltfilt

def bandpass(x: np.ndarray, fs: float, lo: float = 0.5, hi: float = 1.5) -> np.ndarray:
    """Zero-phase band-pass filter (offline only: it uses future samples)."""
    sos = butter(2, [lo, hi], btype="band", fs=fs, output="sos")
    return sosfiltfilt(sos, x)

How I’ll log progress

TODO: how often you post, and what each entry will contain.