home/ atoms/ wavetable-index-increment

The index increment fL/fs replaces per-sample sine computation with a single add per sample

Instead of computing the full argument 2πfn/fs for each sample — which requires a Taylor-series sin() call — wavetable synthesis calculates an index increment kinc = fL/fs once per note event. Each sample, kinc is added to a running index variable, and the wavetable is looked up at that index. When the index exceeds the table size L, it wraps back using fmod or repeated subtraction. This reduces per-sample work to one addition, one fmod (or compare), and one table lookup, versus a full floating-point trigonometric evaluation. Phase increment (2πf/fs) is the physical counterpart; index increment is the implementation-facing equivalent — but index increment avoids the L/2π scaling per sample.

Examples

f=440 Hz, L=64, fs=44100: kinc = 440×64/44100 ≈ 0.6395. Each sample: index += 0.6395; if index >= 64, index -= 64; output = waveTable[floor(index)].

Assessment

Why is index increment more computationally efficient than phase increment when the table size does not change during playback? Identify which calculation is saved per sample.

“Phase increment and index increment are two sides of the same coin. The former has a physical meaning, the latter has an implementational meaning.”
corpus · wavetable-synthesis-algorithm-explained-wolfsound · chunk 3