Expand description
Radix-2 1D FFT GPU compute kernel for OxiGDAL.
This module implements a monomorphic Cooley-Tukey Decimation-In-Time (DIT) radix-2 FFT using WGSL compute shaders dispatched via wgpu. Each workgroup processes exactly one transform; the batch variant dispatches multiple workgroups in parallel.
§Constraints
- Size must be a power of two in the range
[4, 2048]. - All butterfly stages and the bit-reversal function are unrolled in the emitted WGSL because WGSL workgroup-shared memory paths do not allow fully dynamic loop bounds at all WGSL validation levels.
§Sign convention
| Mode | twiddle angle | normalisation |
|---|---|---|
| Forward | -2π · k / N | none |
| Inverse | +2π · k / N | divide by N |
Structs§
- Fft1d
- GPU-accelerated radix-2 1D FFT (or IFFT) kernel.
Functions§
- bit_
reverse - Reverse the bottom
log2_nbits ofx. - make_
fft_ shader_ source - Emit a monomorphic WGSL compute shader for a radix-2 Cooley-Tukey DIT FFT
of exactly
sizepoints. - twiddle_
factor - Compute the twiddle factor for position
kof ann-point transform. - validate_
size - Validate that
sizesatisfies the FFT kernel constraints (power of two, in the range[4, 2048]).