Each simulated motor-cortex neuron i has a fixed preferred direction (PD) spread around the circle. Its trial-averaged firing rate follows the cosine tuning law found by Georgopoulos et al. (1982) in real reaching-task recordings:
r_i(θ) = b0 + b1 · cos(θ − PD_i)
where θ is the true movement direction, b0 the baseline rate and b1 the tuning depth. On every trial each neuron emits a spike count drawn from a Poisson process with mean r_i(θ)·T (T = 1 window), so the population is noisy exactly like real recordings. The classic population vector algorithm decodes θ back out of the spike counts by summing each neuron's preferred-direction unit vector, weighted by how far its count exceeds baseline:
V = Σ_i (c_i − b0)·(cosPD_i, sinPD_i)
θ_decoded = atan2(V_y, V_x)
The decoded arrow (magenta) should track the true target arrow (white); the gap between them is the angular error the readout reports. This exact algorithm — a weighted vector sum over a tuned neural population — is the basis of real intracortical BCIs (e.g. Utah-array systems) that let paralyzed users steer a cursor or robotic arm with thought alone. Because each neuron's Poisson spike noise is independent, averaging over more neurons cancels more of that noise out — the accuracy sweep button demonstrates this directly by measuring mean angular error across population sizes.
- N (neurons) — how many cells contribute to the decode; fewer neurons (simulating array dropout/scarring) makes the estimate noisier.
- Tuning depth — how strongly each neuron's rate depends on direction; low depth means the signal is buried in baseline firing.
- Noise — extra Poisson-count variability layered on top, mimicking session-to-session recording instability.
- New Trial — redraws all spike counts for the same target, showing decode variability across repeated trials.
- Even / Random PDs — switches whether preferred directions are spaced evenly around the circle or drawn at random, as in a real, imperfectly sampled electrode array.