Expand description
Real forward STFT over actual audio samples — Hann-windowed framing through the
forge FFT (crate::wgsl_forge::dispatch::fft_f32, GPU best-path with CPU DFT floor).
This is the genuine forward transform that the cold-path sidecar bake consumes:
bake_stft_sidecar_from_samples reduces the real magnitude spectrum to
SPECTRAL_PREVIEW_BINS and writes it through the same header machinery as the
preview-synthesis bake in crate::audio::stft_bake — so the sidecar derives
from real audio, not from a parametric preview.
Heap allocation is fine here: STFT runs at ingest (cold path), never in the zero-heap U3 hot worklet.
Functions§
- bake_
stft_ sidecar_ from_ samples - Bake an STFT sidecar from REAL audio
samples. - forward_
stft - Real forward STFT over
samples. - stft_
magnitudes - Per-frame one-sided magnitude spectrum: the first
frame_size/2 + 1bins (DC … Nyquist) of|X[k]| = sqrt(re² + im²).