Table of contents

Generator source and STFT reference

Kokoro-Hexagon 0a03be39Updated 2026-09-26

The bounded PowerShell reference now implements Kokoro's nine-harmonic SineGen source, voiced/unvoiced noise amplitudes, learned harmonic merge, and the configured 20-point, hop-5, centered Hann STFT and iSTFT. Supplied random draws permit reproducible correctness gates; omitted draws use fresh uniform and Gaussian samples. The source is not a replacement for the learned generator and does not independently produce Kokoro speech. The connected generator prelude assembles magnitude followed by phase into the stock 22-channel spectrum supplied to both noise-convolution stages.

Source identity: Kokoro dfb907a02bba8152ca444717ca5d78747ccb4bec, kokoro/istftnet.py (SineGen, SourceModuleHnNSF, TorchSTFT, Generator) and the pinned model config (upsample rates 10 and 6, iSTFT hop 5, FFT length 20). PyTorch 2b3ec34829036a65cd9d1398ea72a0167dc37470, torch/functional.py (centered reflect STFT defaults) and aten/src/ATen/native/SpectralOps.cpp (inverse FFT, overlap-add, window-squared normalization, centered trim).

Executable gates:

At the configured 300× upsample, the source's random phase added at full-rate sample zero is discarded by subsequent half-pixel linear downsampling. The reference retains that source behavior; it does not substitute a more conventional oscillator phase rule. The current gates do not establish an independent PyTorch numerical differential, learned generator output, final model PCM, or audible speech.