JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

The code of memory: theta–gamma, ripples, and replay

The oscillatory scaffolding the brain uses to organise memory — and how reading and timing to it turns stimulation from a blunt tool into a precise one.

Oscillations as a scaffold

Memory is not written into isolated neurons; it is organised in time by neural oscillations. A leading model of working memory, theta–gamma coding, proposes that individual items are represented by gamma-frequency assemblies, and several items are held in sequence within one slower theta cycle — a discrete slot code carried by nested rhythms.

The signature of this nesting is phase–amplitude coupling (PAC): the amplitude of the fast (gamma) rhythm rises and falls with the phase of the slow (theta) rhythm. PAC is one of the most-used windows onto the temporal organisation of memory and attention.

\mathrm{MVL} = \left| \frac{1}{T}\sum_{t} a_{\gamma}(t)\, e^{i\phi_{\theta}(t)} \right|

One PAC estimator (mean vector length): weight the gamma amplitude a_γ(t) by the instantaneous theta phase φ_θ(t) and average as a complex vector. A large magnitude means gamma power concentrates at a preferred theta phase.

Measuring coupling honestly

Because coupling estimates are easy to compute and easy to fool, the field leans on the modulation index, which asks how far the phase-binned amplitude distribution departs from uniform.

\mathrm{MI} = \frac{1}{\log N}\left(\log N + \sum_{j=1}^{N} \bar{P}_j \log \bar{P}_j\right)

The Tort modulation index: bin the low-frequency phase into N bins, compute the mean high-frequency amplitude P̄_j in each, normalise to a distribution, and measure its Kullback–Leibler divergence from uniform. MI = 0 means no coupling.

Sharp-wave ripples and replay

Away from active behaviour — in quiet rest and sleep — the hippocampus produces brief, high-frequency sharp-wave ripples. During these events, waking activity sequences are compressed and re-run: replay, widely regarded as a mechanism of consolidation that transfers traces toward neocortex.

Ripples are causal, not merely correlated. Experimentally disrupting them impairs consolidation, while prolonging or reinforcing them can improve memory. That makes the ripple a natural target for a closed-loop ripple intervention: detect the event in real time and act within its brief window.

Writing to the code by timing

If memory is organised in time, then when you stimulate matters more than how much. Phase-dependent and brain-state-dependent stimulation deliver pulses locked to a specific oscillatory phase or state, turning a blunt current into a precisely timed nudge.

During sleep, this becomes a promising and comparatively gentle lever. Closed-loop slow-oscillation stimulation — often just phase-locked sounds — and targeted memory reactivation, which re-presents a learning-associated cue during deep sleep, can strengthen consolidation of what was learned that day.