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 formula, to show the math support
The slow-oscillation band is usually taken as roughly to . The instantaneous phase of a band-passed signal is often defined through its analytic signal:
where 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.