Aliases:
tf.contrib.signal.stft
tf.signal.stft
tf.signal.stft(
signals,
frame_length,
frame_step,
fft_length=None,
window_fn=tf.signal.hann_window,
pad_end=False,
name=None
)
Defined in tensorflow/python/ops/signal/spectral_ops.py
.
Computes the Short-time Fourier Transform of signals
.
Implemented with GPU-compatible ops and supports gradients.
Args:
signals
: A[..., samples]
float32
Tensor
of real-valued signals.frame_length
: An integer scalarTensor
. The window length in samples.frame_step
: An integer scalarTensor
. The number of samples to step.fft_length
: An integer scalarTensor
. The size of the FFT to apply. If not provided, uses the smallest power of 2 enclosingframe_length
.window_fn
: A callable that takes a window length and adtype
keyword argument and returns a[window_length]
Tensor
of samples in the provided datatype. If set toNone
, no windowing is used.pad_end
: Whether to pad the end ofsignals
with zeros when the provided frame length and step produces a frame that lies partially past its end.name
: An optional name for the operation.
Returns:
A [..., frames, fft_unique_bins]
Tensor
of complex64
STFT values where
fft_unique_bins
is fft_length // 2 + 1
(the unique components of the
FFT).
Raises:
ValueError
: Ifsignals
is not at least rank 1,frame_length
is not scalar, orframe_step
is not scalar.