---
title: "stft"
sidebar_label: "stft"
description: "Kotlin binding reference: stft."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[stft](stft.md)

# stft

[common]\
fun [stft](stft.md)(input: [Tensor](../Tensor/index.md), nFft: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), hopLength: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, winLength: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, window: [Tensor](../Tensor/index.md)? = null, center: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, padMode: [PadMode](../PadMode/index.md) = PadMode.REFLECT, normalized: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, onesided: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true): [Tensor](../Tensor/index.md)

`stft(input: Tensor, nFft: Long, hopLength: Long? = null, winLength: Long? = null, window: Tensor? = null, center: Boolean = true, padMode: PadMode = PadMode.REFLECT, normalized: Boolean = false, onesided: Boolean = true)`: the `stft` operator. 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.