NEF–SPA CIRCUIT LAB

EXAMPLE 11 · CHAPTER 2.6 · OSCILLATORS AND GESTURES

One syllable cycle, two gesture ramps

Recorded Nengo simulation

One brief start impulse recruits a neural oscillator. Two fixed connections read different parts of its cycle: one drives a lip-closure gesture, the other a vowel gesture. Each gesture has its own recurrent activation circuit. Together they form a reduced /ba/-like example.

Both gesture routes are permanently permitted. There is no selection between syllables here. The recording stops at gesture activation: it does not simulate lip displacement, tongue shape, voicing or the sound of /ba/. This keeps the relation between oscillator phase and gesture dynamics visible.

Read the expanded Chapter 2.6 · Nengo code · Recording details

One oscillator with two permanently connected phase-drive and ramp circuitsA supplied start impulse drives a recurrent two-dimensional oscillator. Different fitted decoders connect it to lip and vowel phase-drive populations. Each drive population feeds its own recurrent gesture activation. Lip scaling is 0.20, vowel scaling 0.05; both ramps use a five-millisecond synaptic time constant. Supplied kick0.15–0.20 s · 0.5 Oscillator2,500 LIF · (x₀, x₁) rotation + cutoff Lip phase drive200 LIF Vowel phase drive200 LIF 54.0°–155.4°105.4°–257.5° Lip activation1,000 LIF Vowel activation1,000 LIF k = 0.20 k = 0.05 Separate bounded feedback(1 − k) · min(0.9, a)

Fixed weights continuously connect the populations. Two fitted oscillator readouts generate phase-dependent drive; no runtime instruction calls “start lip” or “start vowel”. The start rectangle is a supplied Node. Every ellipse contains LIF neurons. There are 4,900 neurons in total.

— / 1.600 s

Loading the recorded simulation…

Inspect:

Replay of one saved 1.6-second neural simulation. The moving dot follows the decoded oscillator coordinates. Controls change the viewing time, not the model.

AT THE CURRENT CURSORLoading…

● Window start · □ Window end. Phase begins at the left and increases counterclockwise through the lower half. The grey circle is a reference; the dark trajectory and green moving dot are recorded neural readouts. The small central disk marks radius below 0.3, where phase is unreliable.

SAME MOMENT · SEPARATE STATES

Decoded phase: —
Oscillator radius: —
Supplied kick: —

Lip phase drive—
Lip activation—
Vowel phase drive—
Vowel activation—

Bars use a 0–1 display scale. Numbers and curves retain the original decoded values, including small negative fluctuations or values above one. These are activation signals, not articulator positions.

A phase boundary starts or ends the drive

The lip window spans 54.0°–155.4°; the vowel window spans 105.4°–257.5°. Their overlap means both drive signals can be present together. The specified window starts do not instantly set the corresponding ramps to their maximum. The specified window ends do not erase the state already accumulated in the ramps.

The desired decoder output is zero below radius 0.3. Outside that central region, it is positive inside the gesture’s phase window and zero elsewhere. Nengo fits this function into connection weights acting on oscillator spikes. Actual transitions are approximate and filtered, rather than exact angle tests during the simulation.

Lip closureVowel activationStart impulse
A · The supplied start impulse0.5 from 0.15 to 0.20 s
B · Neural phase-drive populationsDifferent decoding weights
C · Recurrent gesture activationsLip rises and decays faster

Dashed lines mark the phase-window starts; dotted lines mark their ends, inferred from the filtered oscillator recording. These are reference markers, not commands. A smoothed neural readout can begin rising before a nominal boundary. All decoded observation probes use 10-ms filters; spike events are unfiltered.

What makes a ramp rise?

The ramp receives current phase drive, scaled by k, together with its own bounded recurrent feedback, scaled by 1 − k. Arriving weighted spikes change its population pattern. Recurrence makes its decoded activation develop gradually. “Starting” means adding drive, not switching every neuron on at once.

What makes it fall?

After phase drive ends, the feedback gain below one cannot sustain the positive state indefinitely. Activation decays. This is a leaky, bounded activation circuit, unlike an ideal integrator that would hold with zero input. Its curve is generally an exponential rise and fall, not a perfectly straight ramp.

Why the consonant and vowel have different trajectories

Both ramp connections use 5-ms synaptic filters. The lip circuit uses k = 0.20; the vowel circuit uses k = 0.05. Below the feedback bound, an idealized continuous description gives an effective time constant of 5 ms / k: 25 ms for lip closure and 100 ms for the vowel. The actual curves also include the changing neural drive, finite-population effects and observation filtering.

The bound 0.9 limits the desired recurrent contribution, not total activation. External drive can lift activation above it. The original parameter name velocity denotes this connection scaling, not a measured lip or tongue velocity. A gesture activation determines influence on a target; the target and articulatory mechanics are additional parts of a speech model.

Oscillator
Lip drive
Lip ramp
Vowel drive
Vowel ramp

First 20 cells of each population. A dot stays lit for 25 ms after a recorded spike; brightness is not voltage. Ramp neurons can fire even near decoded zero.

Inspect the five neural spike patterns
Oscillator · cells 1–20 of 2,500
Lip phase drive · cells 1–20 of 200
Lip activation · cells 1–20 of 1,000
Vowel phase drive · cells 1–20 of 200
Vowel activation · cells 1–20 of 1,000

The same saved time and cursor apply to all five rasters. Cells were selected consecutively, before inspecting their firing patterns. The download retains all 4,900 spike trains.

Local timing in this recording

Threshold 0.2, sustained for 20 ms; decoded observation signals
GestureDrive onsetActivation onsetDrive releaseActivation release
Lip closure0.259 s0.279 s0.480 s0.509 s
Vowel0.358 s0.396 s0.666 s0.793 s

Both activation readouts exceed 0.2 together for 113 ms. The vowel takes 127 ms after its drive-release marker to fall below the same threshold; the lip takes 29 ms. These threshold-defined observations describe this small circuit, not whole-model performance or universal consonant and vowel durations.

The Nengo oscillator and two ramps in a few lines

Inside the Nengo network, the start input and oscillator are built as follows. The complete executed script supplies imports, fixed windows, probes, simulation and figure generation.

kick = nengo.Node(lambda t: .5 if .15 <= t < .20 else 0.)
oscillator = nengo.Ensemble(2500, 2,
    intercepts=nengo.dists.Uniform(.3, 1))
nengo.Connection(kick, oscillator,
                 transform=[[-1], [0]], synapse=.005)

def cutoff(x):
    return np.zeros(2) if np.arctan2(x[1], x[0]) > 7.5/8*np.pi else x

tau = .025
omega = 2*np.pi*1.5
nengo.Connection(oscillator, oscillator, function=cutoff,
    transform=[[1, -tau*omega], [tau*omega, 1]], synapse=tau)

def phase_drive(x, window):
    if np.dot(x, x) < .09:
        return 0.
    p = np.arctan2(x[1], x[0]) / (2*np.pi) + .5
    return window[2] if window[0] <= p < window[1] else 0.

windows = {"lip": (.15, .431707317073, 1.),
           "vowel": (.292682926829, .715243902439, .95)}
for name, window in windows.items():
    pulse = nengo.Ensemble(200, 1,
        intercepts=nengo.dists.Uniform(.02, 1))
    nengo.Connection(oscillator, pulse,
        function=lambda x, w=window: phase_drive(x, w), synapse=.005)
    ramp = nengo.Ensemble(1000, 1)
    k = .20 if name == "lip" else .05
    nengo.Connection(pulse, ramp, transform=k, synapse=.005)
    nengo.Connection(ramp, ramp, transform=1-k,
        function=lambda x: min(.9, x[0]), synapse=.005)

The functions specify targets for fitted connection weights; they are not separate runtime angle-checking Nodes. The oscillator cutoff changes its own recurrence above 348.75°. It does not directly clear the ramp populations. They decay according to their own state and feedback.

Read the exact executed source · Download source, full recording, figures and checks (ZIP)

How this example was recorded

One final isolated teaching run: Nengo 4.1.0, NumPy 2.5.4, seed 11, 4,900 LIF neurons, 1-ms integration and recording, duration 1.6 s. The nominal oscillator frequency is 1.5 Hz. Oscillator recurrence uses 25 ms; all other connections use 5 ms. Decoded probes use an additional 10-ms observation filter. All 1,600 original samples are replayed; no artificial noise or synthetic spikes were added.

The phase windows and bounded-ramp rules follow the archived pathway. A preliminary diagnostic with kick amplitude 1 pushed the oscillator outside its nominal representation radius and caused unwanted startup transients. The final run shown here reduces the supplied kick to 0.5. This local shaping check is documented in the manuscript; it is not a new production study.

The oscillator and phase-drive intercepts are uniform on [0.3, 1] and [0.02, 1], respectively. Ramps use default intercepts; all ensembles have radius 1, default LIF membrane dynamics and default maximum-rate distributions. The NPZ download retains every recorded decoded trace and all spike trains. The JSON retains all continuous samples and the displayed 20 cells per population.

Angular markers are interpolated crossings of the filtered oscillator readout while its radius exceeds 0.3. Drive and ramp onset/release markers instead use a sustained amplitude threshold. These measurements should not be equated. The geometric ring is a reference, not a replacement for the neural trajectory.

Browser recording and metadata (JSON) · Original neural recording and source (ZIP) · Static drive and ramp figure · Reproduction notes in Appendix A.7

Readiness, permissions and next-syllable requests are introduced later in Chapter 4 · From syllable to articulation. This example establishes the fixed oscillator-to-gesture circuit first.