Skip to main content

Module stft

Module stft 

Source

Structs§

GpuFft
Backend-agnostic complex FFT over the innermost-but-one axis (the trailing dim is the [re, im] pair); forward or inverse, shape-preserving. Mirrors core::ops::fft::Fft for a supported power-of-two length with axis == rank - 2.
GpuStft
Backend-agnostic fused STFT (frame + window + forward FFT). frame is a supported power of two (SUPPORTED_FRAMES); the window is pre-padded to [frame] (all-ones when the source had none), matching core::ops::fft::Stft’s symmetric padding. The time axis must sit just before the trailing complex pair (axis == rank - 2). Each backend supplies its own dispatch kernel; everything else (facts, output allocation, window upload) is shared.

Constants§

SUPPORTED_FRAMES
The power-of-two FFT frame lengths the GPU STFT kernels support (the radix-2 kernel generalizes to any pow2; these cover Kaldi-style featurizers at 8/16/32/48 kHz).

Functions§

is_supported_frame
Whether the GPU STFT kernels handle this frame length (a supported power of two).
padded_window
Pre-pad window (or all-ones) to [frame] exactly as core Stft does: symmetric padding when shorter than the frame. Shared by every backend’s lowering rule.

Type Aliases§

DispatchFftFn
Per-backend FFT kernel launcher: (inverse, input, output), both interleaved-complex f32 [lead.., N, 2] (N a supported power of two, transformed axis at rank-2). The inverse is UNNORMALIZED, matching core Fft (rustfft). The kernel reads N from the input shape.
DispatchStftFn
Per-backend STFT kernel launcher: (stride, input, window, output). input is interleaved-complex f32 [lead.., T, 2], window the pre-padded real window [frame], output [lead.., frames, frame, 2]. The kernel reads the frame length from the output shape (output[axis + 1]).