Expand description
FFT-based 1D linear convolution for OxiGDAL GPU.
Implements linear convolution via the FFT theorem:
Y = IFFT(FFT(signal) * FFT(kernel))
where * is pointwise complex multiplication. This is equivalent to
direct convolution for finite-length sequences, and is efficient when
both sequences are padded to the same power-of-two length.
§Limitation
The underlying Fft1d kernel supports sizes up to 2048. For inputs
where (signal.len() + kernel.len() - 1).next_power_of_two() > 2048 this
module returns GpuError::InvalidKernelParams. Long signals require an
Overlap-Save or Overlap-Add segmentation strategy (not implemented here).
§Sign convention
Forward FFT: twiddle angle = -2π·k/N (no normalisation).
Inverse FFT: twiddle angle = +2π·k/N, result divided by N.
§Thread safety
FftConvolution holds an Arc<GpuContext> and is Send + Sync.
Structs§
- FftConvolution
- GPU-accelerated FFT-based 1D linear convolution.
Constants§
- MAX_
FFT_ CONVOLUTION_ SIZE - Maximum single-pass FFT size supported by
FftConvolution.
Functions§
- complex_
multiply - Pointwise complex multiplication:
(ar + i·ai) × (br + i·bi). - convolve_
reference - Pure-Rust reference linear convolution (direct O(N·M) algorithm).