Skip to main content

ClikaRT::ops::stft

function

stft()

Tensor stft(
    Tensor x,
    std::int64_t n_fft,
    std::optional<std::int64_t> hop_length = std::nullopt,
    std::optional<std::int64_t> win_length = std::nullopt,
    OptionalTensor window = {},
    bool center = true,
    PadMode pad_mode = PadMode::Reflect,
    bool normalized = false,
    bool onesided = true
)

Short-time Fourier transform of a real [L] / [B, L] signal: frames of win_length (default n_fft) at hop_length strides (default n_fft/4), windowed by window when given (a [win_length] tensor; absent = rectangular). Output [T, n_freq, 2] / [B, T, n_freq, 2] with n_freq = n_fft/2 + 1; frames along the time axis first, interleaved (re, im) pairs. center pads n_fft/2 per side in pad_mode before framing; normalized scales by 1/sqrt(n_fft). Only the one-sided form is served; onesided = false refuses.

Declared in ClikaRT/compute/ops.h, line 3223